summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-11 16:29:09 -0500
committerChris McDonough <chrism@plope.com>2010-11-11 16:29:09 -0500
commit265ea8bcdd0c03fbce21fe969d11cb4ab4177ffa (patch)
tree4fd7c87f3d74978f70531b52c87d6a4419c74175
parenta1365e6f0da69e1b4e3f9cea11222849e5ca810a (diff)
downloadpyramid-265ea8bcdd0c03fbce21fe969d11cb4ab4177ffa.tar.gz
pyramid-265ea8bcdd0c03fbce21fe969d11cb4ab4177ffa.tar.bz2
pyramid-265ea8bcdd0c03fbce21fe969d11cb4ab4177ffa.zip
stamp out inappropriate use of get_settings
-rw-r--r--TODO.txt5
-rw-r--r--pyramid/i18n.py3
2 files changed, 3 insertions, 5 deletions
diff --git a/TODO.txt b/TODO.txt
index c3d987c6a..5f10acb13 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -116,9 +116,8 @@
chameleon_text.TextTemplateRenderer.template (also uses get_settings),
chameleon_zpt.ZPTTemplateRenderer.template (also uses get_settings),
resource.OverrideProvider._get_overrides, traversal.traverse,
- Configurator.add_translation_dirs (get_current_request),
- i18n.negotiate_locale_name (get_settings). All ZCML directives use
- ``get_current_registry`` to obtain the registry.
+ Configurator.add_translation_dirs (get_current_request). All ZCML
+ directives use ``get_current_registry`` to obtain the registry.
- Add deprecation warnings for:
diff --git a/pyramid/i18n.py b/pyramid/i18n.py
index d71a27205..ee4a693da 100644
--- a/pyramid/i18n.py
+++ b/pyramid/i18n.py
@@ -13,7 +13,6 @@ from pyramid.interfaces import ILocalizer
from pyramid.interfaces import ITranslationDirectories
from pyramid.interfaces import ILocaleNegotiator
-from pyramid.settings import get_settings
from pyramid.threadlocal import get_current_registry
class Localizer(object):
@@ -132,7 +131,7 @@ def negotiate_locale_name(request):
locale_name = negotiator(request)
if locale_name is None:
- settings = get_settings() or {}
+ settings = registry.settings or {}
locale_name = settings.get('default_locale_name', 'en')
return locale_name