summaryrefslogtreecommitdiffstats
path: root/pyload/utils
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-07 22:22:18 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-07 22:22:18 +0200
commitd2fe85670726901da627490da4155af972c1a62e (patch)
treeb8931d070a51b6d8b1dabe881f54504f9d9ef6de /pyload/utils
parentUpdate user-agent (diff)
parentfix gui (diff)
downloadpyload-d2fe85670726901da627490da4155af972c1a62e.tar.xz
Merge branch 'pr/n1_ardi69' into 0.4.10
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)