diff options
Diffstat (limited to 'tmpl.py')
-rw-r--r-- | tmpl.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -8,15 +8,17 @@ from genshi.filters import Translator import gettext -languages = {'en': None, 'de': None} +languages = {'en': None, 'de': None, 'ja': None} for l in languages.keys(): languages[l] = gettext.translation('subdap', os.path.join(os.path.dirname(__file__), 'locale'), [l], fallback = True) - print l, '->', languages[l] def do_translate(text): - return cherrypy.thread_data.translations.gettext(text) + transl = cherrypy.thread_data.translations.gettext(text) + if type(transl) == unicode: + return transl + return transl.decode('utf-8') def select_language(): if cherrypy.thread_data.lang != None: lang = cherrypy.thread_data.lang |