diff options
| author | Michael Merickel <michael@merickel.org> | 2014-11-17 02:27:03 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2014-11-17 02:27:03 -0600 |
| commit | 5d0b1beaf3b09045fd3dd71244938ee6e391ebf3 (patch) | |
| tree | 2fd3a374d4c937184497e5589bcf93391833949a /docs/narr/i18n.rst | |
| parent | 650d3d5fa383d89a3b28029162d6ef4d58be3da1 (diff) | |
| parent | c0f1fc8d31df45371d5ae6689d3e0a39c058c3ac (diff) | |
| download | pyramid-5d0b1beaf3b09045fd3dd71244938ee6e391ebf3.tar.gz pyramid-5d0b1beaf3b09045fd3dd71244938ee6e391ebf3.tar.bz2 pyramid-5d0b1beaf3b09045fd3dd71244938ee6e391ebf3.zip | |
Merge branch 'master' into feature.override-asset-with-absolute-path
Diffstat (limited to 'docs/narr/i18n.rst')
| -rw-r--r-- | docs/narr/i18n.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/narr/i18n.rst b/docs/narr/i18n.rst index 95f663584..3c804a158 100644 --- a/docs/narr/i18n.rst +++ b/docs/narr/i18n.rst @@ -354,7 +354,7 @@ command from Gettext: $ mkdir -p es/LC_MESSAGES $ msginit -l es -o es/LC_MESSAGES/myapplication.po -This will create a new the message catalog ``.po`` file will in: +This will create a new message catalog ``.po`` file in: ``myapplication/locale/es/LC_MESSAGES/myapplication.po``. @@ -792,9 +792,11 @@ Then as a part of the code of a custom :term:`locale negotiator`: .. code-block:: python :linenos: - from pyramid.threadlocal import get_current_registry - settings = get_current_registry().settings - languages = settings['available_languages'].split() + from pyramid.settings import aslist + + def my_locale_negotiator(request): + languages = aslist(request.registry.settings['available_languages']) + # ... This is only a suggestion. You can create your own "available languages" configuration scheme as necessary. |
