Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 50f87d9
Showing
7 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# coding: utf-8 | ||
from wsgiref.simple_server import make_server | ||
from pyramid.config import Configurator | ||
from pyramid.response import Response | ||
|
||
from pyramid.i18n import TranslationStringFactory | ||
_ = TranslationStringFactory('dom') | ||
|
||
|
||
def hello_world(request): | ||
ts = _('Add') | ||
localizer = request.localizer | ||
translated = localizer.translate(ts) | ||
return Response('%s %s!' % (translated, request.matchdict['name'])) | ||
|
||
if __name__ == '__main__': | ||
config = Configurator(settings={'pyramid.default_locale_name': 'de'}) | ||
config.add_route('hello', '/hello/{name}') | ||
config.add_view(hello_world, route_name='hello') | ||
# config.add_translation_dirs('locale', 'locale_override') | ||
## -> Addieren (override) | ||
|
||
# config.add_translation_dirs('locale_override', 'locale') | ||
## -> Hinzufügen (non-override) | ||
|
||
config.add_translation_dirs('locale_override') | ||
config.add_translation_dirs('locale') | ||
## -> Addieren (override) | ||
|
||
app = config.make_wsgi_app() | ||
server = make_server('0.0.0.0', 8123, app) | ||
server.serve_forever() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# German translations for PACKAGE package | ||
# This file is distributed under the same license as the PACKAGE package. | ||
# rbu <rb@sntl-publishing.com>, 2014. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE 1.0\n" | ||
"POT-Creation-Date: 2014-11-25 11:04+0100\n" | ||
"PO-Revision-Date: 2014-11-25 11:14+0100\n" | ||
"Last-Translator: rbu <rb@sntl-publishing.com>\n" | ||
"Language-Team: German\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Language: de\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
|
||
#: helloworld.py:10 | ||
msgid "Add" | ||
msgstr "Hinzufügen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# SOME DESCRIPTIVE TITLE | ||
# This file is distributed under the same license as the PACKAGE package. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014. | ||
#, fuzzy | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE 1.0\n" | ||
"POT-Creation-Date: 2014-11-25 11:04+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" | ||
"Language: \n" | ||
|
||
#: ././helloworld.py:10 | ||
msgid "Add" | ||
msgstr "" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# German translations for PACKAGE package | ||
# This file is distributed under the same license as the PACKAGE package. | ||
# rbu <rb@sntl-publishing.com>, 2014. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE 1.0\n" | ||
"POT-Creation-Date: 2014-11-25 11:04+0100\n" | ||
"PO-Revision-Date: 2014-11-25 11:14+0100\n" | ||
"Last-Translator: rbu <rb@sntl-publishing.com>\n" | ||
"Language-Team: German\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Language: de\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
|
||
#: helloworld.py:10 | ||
msgid "Add" | ||
msgstr "Addieren" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# SOME DESCRIPTIVE TITLE | ||
# This file is distributed under the same license as the PACKAGE package. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014. | ||
#, fuzzy | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE 1.0\n" | ||
"POT-Creation-Date: 2014-11-25 11:04+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" | ||
"Language: \n" | ||
|
||
#: ././helloworld.py:10 | ||
msgid "Add" | ||
msgstr "" |