summaryrefslogtreecommitdiff
path: root/tmpl.py
diff options
context:
space:
mode:
Diffstat (limited to 'tmpl.py')
-rw-r--r--tmpl.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tmpl.py b/tmpl.py
index b761ec2..3e7d8b5 100644
--- a/tmpl.py
+++ b/tmpl.py
@@ -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