From 9b85f11e1d9f181679c2cf9ce86d008d6e875888 Mon Sep 17 00:00:00 2001 From: equinox Date: Tue, 27 Sep 2011 10:22:11 +0200 Subject: more i18n --- de.po | 39 +++++++++++++++++++++++++------ index.py | 18 +++++++-------- ja.po | 61 ++++++++++++++++++++++++++++++++----------------- templates/create.html | 2 +- templates/login.html | 2 +- templates/pwchange.html | 2 +- tmpl.py | 3 ++- 7 files changed, 86 insertions(+), 41 deletions(-) diff --git a/de.po b/de.po index 060ce90..75bc247 100644 --- a/de.po +++ b/de.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-09-27 07:17+0200\n" +"POT-Creation-Date: 2011-09-27 10:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,28 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.6\n" -#: templates/8021x.html:10 templates/login.html:9 templates/select.html:10 +#: index.py:67 index.py:69 index.py:79 index.py:81 +msgid "Login incorrect" +msgstr "Login fehlerhaft" + +#: index.py:116 +msgid "please specify an user name" +msgstr "Bitte einen Usernamen angeben" + +#: index.py:118 +msgid "username invalid" +msgstr "Username ungültig" + +#: index.py:120 +msgid "please specify a password of at least 6 characters" +msgstr "Bitte ein Passwort mit mindestens 6 Zeichen wählen" + +#: index.py:122 +msgid "passwords did not match" +msgstr "Passwörter stimmen nicht überein" + +#: templates/8021x.html:10 templates/login.html:9 templates/login.html:18 +#: templates/select.html:10 msgid "login" msgstr "login" @@ -63,7 +84,7 @@ msgstr "" "\tpriority=500\n" "}" -#: templates/create.html:9 +#: templates/create.html:9 templates/create.html:19 msgid "create" msgstr "anlegen" @@ -100,7 +121,8 @@ msgid "" " [5:%(exception)s]" msgstr "" "[1:kaputt!]\n" -" [2:[3:subdap.exe] hat ein Problem festgestellt und musste beendet werden.\n" +" [2:[3:subdap.exe] hat ein Problem festgestellt und musste beendet " +"werden.\n" " Bitte schicken sie einen Fehlerbericht an [4:equinox ! diac24 ! net].]\n" " [5:%(exception)s]" @@ -116,7 +138,8 @@ msgstr "info" msgid "create account" msgstr "Account anlegen" -#: templates/pwchange.html:8 templates/select.html:26 +#: templates/pwchange.html:8 templates/pwchange.html:20 +#: templates/select.html:26 msgid "change password" msgstr "Passwort ändern" @@ -140,8 +163,10 @@ msgid "" " password will work." msgstr "" "[1:Passwort wurde geändert.][2:]\n" -" — bitte beachten: Es kann einige Minuten dauern, bis Kerberos seine [3:drei\n" -" Köpfe] synchronisiert hat. Es kann daher sowohl das alte als auch das neue\n" +" — bitte beachten: Es kann einige Minuten dauern, bis Kerberos seine [3:" +"drei\n" +" Köpfe] synchronisiert hat. Es kann daher sowohl das alte als auch das " +"neue\n" " Passwort funktionieren." #: templates/select.html:20 diff --git a/index.py b/index.py index cc36806..27c1a08 100755 --- a/index.py +++ b/index.py @@ -7,7 +7,7 @@ sys.path.append(appbase) import threading import cherrypy -from tmpl import expose, render +from tmpl import expose, render, _ from lxml import etree from lxml.html import formfill from StringIO import StringIO @@ -61,9 +61,9 @@ class SubdapSite(object): l.start_tls_s() l.simple_bind_s(dn, password) except ldap.INVALID_CREDENTIALS: - raise LoginError('Login incorrect') + raise LoginError(_('Login incorrect')) except ldap.LDAPError, e: - raise LoginError('Login incorrect') + raise LoginError(_('Login incorrect')) # e.message['info'] return (l, dn) @@ -73,9 +73,9 @@ class SubdapSite(object): return render(errors = {}) if username == None or password == None: - return render(errors = {'password': 'Login incorrect'}) + return render(errors = {'password': _('Login incorrect')}) if username == '' or password == '': - return render(errors = {'password': 'Login incorrect'}) + return render(errors = {'password': _('Login incorrect')}) try: l, dn = s.login_perform(username, password) except LoginError, e: @@ -105,13 +105,13 @@ class SubdapSite(object): def newpass_validate(s, username, password, password2, expectstate): errors = {} if username == None or username == '': - errors['username'] = 'please specify an user name' + errors['username'] = _('please specify an user name') elif accountservice.name_valid(username) != expectstate: - errors['username'] = 'username invalid' + errors['username'] = _('username invalid') if password == None or len(password) < 6: - errors['password'] = 'please specify a password of at least 6 characters' + errors['password'] = _('please specify a password of at least 6 characters') if password2 != password: - errors['password2'] = 'passwords did not match' + errors['password2'] = _('passwords did not match') if len(errors) > 0: return errors return None diff --git a/ja.po b/ja.po index 76ddd8e..77946ef 100644 --- a/ja.po +++ b/ja.po @@ -8,18 +8,40 @@ 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" +"POT-Creation-Date: 2011-09-27 10:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\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 +#: index.py:67 index.py:69 index.py:79 index.py:81 +msgid "Login incorrect" +msgstr "ログイン無効" + +#: index.py:116 +msgid "please specify an user name" +msgstr "ユーザ名を入力してください" + +#: index.py:118 +msgid "username invalid" +msgstr "ユーザ名無効" + +#: index.py:120 +msgid "please specify a password of at least 6 characters" +msgstr "パスワードは短すぎる。6字選んでください!" + +#: index.py:122 +msgid "passwords did not match" +msgstr "パスワードは合わなかっている" + +#: templates/8021x.html:10 templates/login.html:9 templates/login.html:18 +#: templates/select.html:10 msgid "login" -msgstr "" +msgstr "ログイン" #: templates/8021x.html:14 msgid "wpa_supplicant WPA-EAP template" @@ -46,17 +68,17 @@ msgid "" "}" msgstr "" -#: templates/create.html:9 +#: templates/create.html:9 templates/create.html:19 msgid "create" msgstr "作って" #: templates/create.html:13 templates/login.html:14 templates/pwchange.html:12 msgid "uid:" -msgstr "ユーザー" +msgstr "ユーザ名" #: templates/create.html:15 templates/login.html:16 templates/pwchange.html:16 msgid "password:" -msgstr "暗号" +msgstr "パスワード" #: templates/create.html:17 templates/pwchange.html:18 msgid "repeat:" @@ -64,10 +86,9 @@ msgstr "もう一度" #: templates/create.html:20 msgid "" -"The account creation process takes around 20 to 30 seconds. Please do not" -" spam the button." -msgstr "" -"ウーザーを作る操作は25秒ぐらい掛かります。我慢してください!" +"The account creation process takes around 20 to 30 seconds. Please do not " +"spam the button." +msgstr "ログインを作る操作は25秒ぐらい掛かります。我慢してください!" #: templates/error.html:10 msgid "exception" @@ -92,36 +113,35 @@ msgstr "info" #: templates/login.html:13 msgid "create account" -msgstr "ウーザーを作る操" +msgstr "ログインを作る操" -#: templates/pwchange.html:8 templates/select.html:26 +#: templates/pwchange.html:8 templates/pwchange.html:20 +#: templates/select.html:26 msgid "change password" -msgstr "暗号を改める" +msgstr "パスワードを改める" #: templates/pwchange.html:14 msgid "old password:" -msgstr "まえの暗号" +msgstr "まえのパスワード" #: templates/pwchange.html:21 msgid "" "The password change process takes around 20 to 30 seconds. Please do not " "spam the button." -msgstr "" -"暗号を変わる操作は25秒ぐらい掛かります。我慢してください!" +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" +" 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さん!" +msgstr "%(hi)sさんこんにちは!" #: templates/select.html:22 msgid "sublab.org wiki" @@ -134,4 +154,3 @@ msgstr "802.1X鋳型" #: templates/select.html:28 msgid "administration" msgstr "" - diff --git a/templates/create.html b/templates/create.html index 4cb8e54..71e64b3 100644 --- a/templates/create.html +++ b/templates/create.html @@ -16,7 +16,7 @@ ${errors.password}
repeat:
${errors.password2} - +

The account creation process takes around 20 to 30 seconds. Please do not spam the button.

diff --git a/templates/login.html b/templates/login.html index 754fa2f..8112f0e 100644 --- a/templates/login.html +++ b/templates/login.html @@ -15,7 +15,7 @@ ${errors.username}
password:
${errors.password} - + Deutsch English diff --git a/templates/pwchange.html b/templates/pwchange.html index ec6ea34..9120644 100644 --- a/templates/pwchange.html +++ b/templates/pwchange.html @@ -17,7 +17,7 @@ ${errors.password}
repeat:
${errors.password2} - +

The password change process takes around 20 to 30 seconds. Please do not spam the button.

diff --git a/tmpl.py b/tmpl.py index 3e7d8b5..e9f3483 100644 --- a/tmpl.py +++ b/tmpl.py @@ -19,6 +19,7 @@ def do_translate(text): if type(transl) == unicode: return transl return transl.decode('utf-8') +_ = do_translate def select_language(): if cherrypy.thread_data.lang != None: lang = cherrypy.thread_data.lang @@ -55,7 +56,7 @@ def render(*args, **kwargs): template = cherrypy.thread_data.template #ctxt = Context(url = cherrypy.url) - ctxt = Context(url = myurl, lang = cherrypy.thread_data.lang) + ctxt = Context(url = myurl, lang = cherrypy.thread_data.lang, _ = do_translate) ctxt.push(kwargs) return template.generate(ctxt) -- cgit v1.2.1