From ff31e814bdc78d57e18a66020508d7e703acf8f5 Mon Sep 17 00:00:00 2001 From: equinox Date: Tue, 27 Sep 2011 09:48:21 +0200 Subject: =?UTF-8?q?=E6=A5=BD=E3=81=97=E3=81=8B=E3=81=A3=E3=81=9F=E3=82=8F?= =?UTF-8?q?=E3=82=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + i18n-update | 2 +- ja.po | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++ static/lang_ja.png | Bin 0 -> 420 bytes templates/login.html | 1 + tmpl.py | 8 +-- 6 files changed, 145 insertions(+), 4 deletions(-) create mode 100644 ja.po create mode 100755 static/lang_ja.png diff --git a/.gitignore b/.gitignore index dc3eb23..86b6c8c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ locale *.svg *.old *.pot +*.poT diff --git a/i18n-update b/i18n-update index 5159100..48d2a21 100755 --- a/i18n-update +++ b/i18n-update @@ -1,6 +1,6 @@ #!/bin/sh for i in *.po -do dir="locale/${i%.mo}/LC_MESSAGES" +do dir="locale/${i%.po}/LC_MESSAGES" [ -d "$dir" ] || mkdir -p "$dir" msgfmt -v "$i" -o "$dir/subdap.mo" done diff --git a/ja.po b/ja.po new file mode 100644 index 0000000..76ddd8e --- /dev/null +++ b/ja.po @@ -0,0 +1,137 @@ +# Translations template for PROJECT. +# Copyright (C) 2011 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2011. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2011-09-27 08:39+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +#: templates/8021x.html:10 templates/login.html:9 templates/select.html:10 +msgid "login" +msgstr "" + +#: templates/8021x.html:14 +msgid "wpa_supplicant WPA-EAP template" +msgstr "" + +#: templates/8021x.html:15 +#, python-format +msgid "" +"network={\n" +"\tscan_ssid=1\n" +"\tssid=\"crew.sublab.org\"\n" +"\n" +"\tkey_mgmt=WPA-EAP\n" +"\teap=TTLS\n" +"\tphase2=\"auth=PAP\"\n" +"\n" +"\tidentity=\"%(8021x)s\"\n" +"\tpassword=\"[1:insert password here]\"\n" +"\n" +"\tanonymous_identity=\"bernd\"\n" +"\tca_cert=\"[2:/etc/ssl/certs/cacert.org.pem]\"\n" +"\taltsubject_match=\"DNS:taifun.local.sublab.org\"\n" +"\tpriority=500\n" +"}" +msgstr "" + +#: templates/create.html:9 +msgid "create" +msgstr "作って" + +#: templates/create.html:13 templates/login.html:14 templates/pwchange.html:12 +msgid "uid:" +msgstr "ユーザー" + +#: templates/create.html:15 templates/login.html:16 templates/pwchange.html:16 +msgid "password:" +msgstr "暗号" + +#: templates/create.html:17 templates/pwchange.html:18 +msgid "repeat:" +msgstr "もう一度" + +#: templates/create.html:20 +msgid "" +"The account creation process takes around 20 to 30 seconds. Please do not" +" spam the button." +msgstr "" +"ウーザーを作る操作は25秒ぐらい掛かります。我慢してください!" + +#: templates/error.html:10 +msgid "exception" +msgstr "間違えたそう" + +#: templates/error.html:14 +#, python-format +msgid "" +"[1:broken!]\n" +" [2:[3:subdap.exe] has detected a problem and had to be terminated.\n" +" Please send an error report to [4:equinox ! diac24 ! net].]\n" +" [5:%(exception)s]" +msgstr "" + +#: templates/layout.xi:11 templates/layout.xi:28 templates/layout.xi:37 +msgid "subdap" +msgstr "subdap" + +#: templates/layout.xi:19 +msgid "info" +msgstr "info" + +#: templates/login.html:13 +msgid "create account" +msgstr "ウーザーを作る操" + +#: templates/pwchange.html:8 templates/select.html:26 +msgid "change password" +msgstr "暗号を改める" + +#: templates/pwchange.html:14 +msgid "old password:" +msgstr "まえの暗号" + +#: templates/pwchange.html:21 +msgid "" +"The password change process takes around 20 to 30 seconds. Please do not " +"spam the button." +msgstr "" +"暗号を変わる操作は25秒ぐらい掛かります。我慢してください!" + +#: templates/select.html:12 +msgid "" +"[1:Your password has been changed.][2:]\n" +" — please note that it may take a few minutes for Kerberos to update\n" +" its [3:three heads]. At any moment, either your old password or your " +"new\n" +" password will work." +msgstr "" + +#: templates/select.html:20 +#, python-format +msgid "Hi %(hi)s!" +msgstr "こんにちは%(hi)sさん!" + +#: templates/select.html:22 +msgid "sublab.org wiki" +msgstr "sublab.orgウィキ" + +#: templates/select.html:24 +msgid "802.1X template" +msgstr "802.1X鋳型" + +#: templates/select.html:28 +msgid "administration" +msgstr "" + diff --git a/static/lang_ja.png b/static/lang_ja.png new file mode 100755 index 0000000..325fbad Binary files /dev/null and b/static/lang_ja.png differ diff --git a/templates/login.html b/templates/login.html index 3ca7299..754fa2f 100644 --- a/templates/login.html +++ b/templates/login.html @@ -19,5 +19,6 @@ Deutsch English + 日本語 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 -- cgit v1.2.1