diff options
| author | Michael Merickel <michael@merickel.org> | 2014-08-14 09:45:18 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2014-08-14 09:45:18 -0500 |
| commit | c613d39971f0af0665fc82ce6bee2e8da25d34ba (patch) | |
| tree | 6e56433148c706d33e05e00bee0f470e23c6140c | |
| parent | 3587a53dc28b8f6411816ccd7fd8fdee0d88acb4 (diff) | |
| parent | ddc745ff6497a5c08c44e2fc8f722ad0034948dc (diff) | |
| download | pyramid-c613d39971f0af0665fc82ce6bee2e8da25d34ba.tar.gz pyramid-c613d39971f0af0665fc82ce6bee2e8da25d34ba.tar.bz2 pyramid-c613d39971f0af0665fc82ce6bee2e8da25d34ba.zip | |
Merge pull request #1400 from tisdall/doc_update
remove unnecessary use of `get_current_registry()`
| -rw-r--r-- | docs/narr/i18n.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/narr/i18n.rst b/docs/narr/i18n.rst index 95f663584..3313f8dad 100644 --- a/docs/narr/i18n.rst +++ b/docs/narr/i18n.rst @@ -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. |
