initial Pylons i18n
authorJan Dittberner <jan@dittberner.info>
Tue, 20 Jan 2009 22:25:49 +0000 (23:25 +0100)
committerJan Dittberner <jan@dittberner.info>
Tue, 20 Jan 2009 22:25:49 +0000 (23:25 +0100)
include language detection support in BaseController
add initial german translation

ddportfolioservice/i18n/ddportfolioservice.pot [new file with mode: 0644]
ddportfolioservice/i18n/de/LC_MESSAGES/ddportfolioservice.mo [new file with mode: 0644]
ddportfolioservice/i18n/de/LC_MESSAGES/ddportfolioservice.po [new file with mode: 0644]
ddportfolioservice/lib/base.py

diff --git a/ddportfolioservice/i18n/ddportfolioservice.pot b/ddportfolioservice/i18n/ddportfolioservice.pot
new file mode 100644 (file)
index 0000000..1535eeb
--- /dev/null
@@ -0,0 +1,55 @@
+# Translations template for ddportfolioservice.
+# Copyright (C) 2009 ORGANIZATION
+# This file is distributed under the same license as the ddportfolioservice
+# project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ddportfolioservice 0.1\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2009-01-20 23:13+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.1\n"
+
+#: ddportfolioservice/ddportfolio.py:35
+#, python-format
+msgid "unable to parse %s: %s"
+msgstr ""
+
+#: ddportfolioservice/ddportfolio.py:69 ddportfolioservice/ddportfolio.py:81
+#: ddportfolioservice/ddportfolio.py:86
+#: ddportfolioservice/templates/showform.mako:5
+#: ddportfolioservice/templates/showform.mako:10
+msgid "Debian Developer Portfolio"
+msgstr ""
+
+#: ddportfolioservice/ddportfolio.py:87
+#: ddportfolioservice/templates/showform.mako:11
+msgid "Name:"
+msgstr ""
+
+#: ddportfolioservice/ddportfolio.py:89
+msgid "E-Mail:"
+msgstr ""
+
+#: ddportfolioservice/ddportfolio.py:91
+#: ddportfolioservice/templates/showform.mako:15
+msgid "User name:"
+msgstr ""
+
+#: ddportfolioservice/ddportfolio.py:93
+#: ddportfolioservice/templates/showform.mako:17
+msgid "Build DD Portfolio URLs"
+msgstr ""
+
+#: ddportfolioservice/templates/showform.mako:13
+msgid "E-Mail address:"
+msgstr ""
+
diff --git a/ddportfolioservice/i18n/de/LC_MESSAGES/ddportfolioservice.mo b/ddportfolioservice/i18n/de/LC_MESSAGES/ddportfolioservice.mo
new file mode 100644 (file)
index 0000000..e99efc1
Binary files /dev/null and b/ddportfolioservice/i18n/de/LC_MESSAGES/ddportfolioservice.mo differ
diff --git a/ddportfolioservice/i18n/de/LC_MESSAGES/ddportfolioservice.po b/ddportfolioservice/i18n/de/LC_MESSAGES/ddportfolioservice.po
new file mode 100644 (file)
index 0000000..05c5688
--- /dev/null
@@ -0,0 +1,55 @@
+# German translations for ddportfolioservice.
+# Copyright (C) 2009 Jan Dittberner
+# This file is distributed under the same license as the ddportfolioservice
+# project.
+# Jan Dittberner <jan@dittberner.info>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ddportfolioservice 0.1\n"
+"Report-Msgid-Bugs-To: jan@dittberner.info\n"
+"POT-Creation-Date: 2009-01-20 23:13+0100\n"
+"PO-Revision-Date: 2009-01-20 23:24+0100\n"
+"Last-Translator: Jan Dittberner <jan@dittberner.info>\n"
+"Language-Team: de <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.1\n"
+
+#: ddportfolioservice/ddportfolio.py:35
+#, python-format
+msgid "unable to parse %s: %s"
+msgstr "Konnte %s nicht parsen: %s"
+
+#: ddportfolioservice/ddportfolio.py:69 ddportfolioservice/ddportfolio.py:81
+#: ddportfolioservice/ddportfolio.py:86
+#: ddportfolioservice/templates/showform.mako:5
+#: ddportfolioservice/templates/showform.mako:10
+msgid "Debian Developer Portfolio"
+msgstr "Debian-Entwicklerportfolio"
+
+#: ddportfolioservice/ddportfolio.py:87
+#: ddportfolioservice/templates/showform.mako:11
+msgid "Name:"
+msgstr "Name:"
+
+#: ddportfolioservice/ddportfolio.py:89
+msgid "E-Mail:"
+msgstr "E-Mail"
+
+#: ddportfolioservice/ddportfolio.py:91
+#: ddportfolioservice/templates/showform.mako:15
+msgid "User name:"
+msgstr "Benutzername:"
+
+#: ddportfolioservice/ddportfolio.py:93
+#: ddportfolioservice/templates/showform.mako:17
+msgid "Build DD Portfolio URLs"
+msgstr "Debian-Entwicklerportfolio-URLs bauen"
+
+#: ddportfolioservice/templates/showform.mako:13
+msgid "E-Mail address:"
+msgstr "E-Mailadresse:"
+
index ce88636..0bad547 100644 (file)
@@ -7,7 +7,7 @@ from pylons import c, cache, config, g, request, response, session
 from pylons.controllers import WSGIController
 from pylons.controllers.util import abort, etag_cache, redirect_to
 from pylons.decorators import jsonify, validate
-from pylons.i18n import _, ungettext, N_
+from pylons.i18n import _, ungettext, N_, add_fallback
 from pylons.templating import render
 
 import ddportfolioservice.lib.helpers as h
@@ -20,6 +20,12 @@ class BaseController(WSGIController):
         # WSGIController.__call__ dispatches to the Controller method
         # the request is routed to. This routing information is
         # available in environ['pylons.routes_dict']
+        # set language environment
+        for lang in request.languages:
+            try:
+                add_fallback(lang)
+            except:
+                pass
         return WSGIController.__call__(self, environ, start_response)
 
 # Include the '_' function in the public names