プロジェクトを国際化したいと思っています。公式ドキュメントに記載されている方法に従いましたが、ローカリゼーションはまだ機能しません。ユーザーロケールを取得する方法は次のとおりです。
def get_locale_name(request):
    """ Return the :term:`locale name` associated with the current
    request (possibly cached)."""
    locale_name = getattr(request, 'locale_name', None)
    if locale_name is None:
       locale_name = negotiate_locale_name(request)
       request.locale_name = locale_name
   return locale_name
ただしrequest、attr "local_name"はありませんが、 "Accept-Language"があるため、関数get_local_nameがリクエストで "local_name"を見つけられない場合は、別の関数を呼び出します。
def negotiate_locale_name(request):
    """ Negotiate and return the :term:`locale name` associated with
    the current request (never cached)."""
    try:
        registry = request.registry
    except AttributeError:
        registry = get_current_registry()
    negotiator = registry.queryUtility(ILocaleNegotiator,
                                       default=default_locale_negotiator)
    locale_name = negotiator(request)
   if locale_name is None:
        settings = registry.settings or {}
        locale_name = settings.get('default_locale_name', 'en')
   return locale_name
グローバル環境からローカルを取得しようとしているのをどのように確認できnegotiatorますが、それができない場合は、configから設定値を取得します。そして、Pyramidがリクエストのフィールド「Accept-Language」から直接ロケールを取得しない理由を理解できませんか?
そして、どうすればロケールを正しく判断できますか?