summaryrefslogtreecommitdiffstats
path: root/pyload/utils
diff options
context:
space:
mode:
authorGravatar root <root@raspberrypi.(none)> 2015-04-03 16:27:52 +0200
committerGravatar root <root@raspberrypi.(none)> 2015-04-03 16:27:52 +0200
commitd55f8011f6853bffa13f903b8c5c8e9365366ec3 (patch)
tree62c0f9dc3a4b4a782f95431c333381e4696763bd /pyload/utils
parentMerge branch 'pr/n1156_ItachiSan' into 0.4.10 (diff)
downloadpyload-d55f8011f6853bffa13f903b8c5c8e9365366ec3.tar.xz
some fixes
Diffstat (limited to 'pyload/utils')
-rw-r--r--pyload/utils/__init__.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py
index bfcc48621..46b375e7a 100644
--- a/pyload/utils/__init__.py
+++ b/pyload/utils/__init__.py
@@ -8,7 +8,8 @@ import re
import sys
import time
-from gettext import gettext
+#from gettext import gettext
+import pylgettext as gettext
from htmlentitydefs import name2codepoint
from os.path import join
from string import maketrans
@@ -252,11 +253,14 @@ def versiontuple(v): #: By kindall (http://stackoverflow.com/a/11887825)
def load_translation(name, locale, default="en"):
""" Load language and return its translation object or None """
+ from traceback import print_exc
+ from os.path import join
try:
- gettext.setpaths([path.join(os.sep, "usr", "share", "pyload", "locale"), None])
- translation = gettext.translation(name, self.path("locale"),
+ gettext.setpaths([join(os.sep, "usr", "share", "pyload", "locale"), None])
+ translation = gettext.translation(name, join(pypath, "locale"),
languages=[locale, default], fallback=True)
except Exception:
+ print_exc()
return None
else:
translation.install(True)