summaryrefslogtreecommitdiffstats
path: root/pykolab/translate.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/translate.py')
-rw-r--r--pykolab/translate.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pykolab/translate.py b/pykolab/translate.py
index 85f4516..080cbc2 100644
--- a/pykolab/translate.py
+++ b/pykolab/translate.py
@@ -26,9 +26,10 @@ import gettext
import os
N_ = lambda x: x
-_ = lambda x: gettext.ldgettext(domain, x)
+_ = lambda x: current.lgettext(x)
-#gettext.bindtextdomain(domain, '/usr/local/share/locale')
+localedir = '/usr/local/share/locale'
+current = gettext.translation(domain, localedir, fallback=True)
def getDefaultLangs():
languages = []
@@ -49,15 +50,14 @@ def getDefaultLangs():
return nelangs
def setUserLanguage(lang):
+ global current
+
langs = []
for l in gettext._expand_lang(lang):
if l not in langs:
langs.append(l)
try:
- translation = gettext.translation(domain, languages=langs)
- translation.install()
+ current = gettext.translation(domain, localedir, languages=langs, fallback=True)
except:
- return False
-
- return True
+ pass