Ticket #14461: accept_more_langs.diff

File accept_more_langs.diff, 907 bytes (added by diegobz, 14 years ago)
  • django/utils/translation/trans_real.py

     
    321321    session.
    322322    """
    323323    from django.conf import settings
    324     globalpath = os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
    325     if gettext_module.find('django', globalpath, [to_locale(lang_code)]) is not None:
    326         return True
    327     else:
    328         return False
     324    paths = list(settings.LOCALE_PATHS)
     325    paths.insert(0, os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale'))
     326    for path in paths:
     327        if gettext_module.find('django', path, [to_locale(lang_code)]) is not None:
     328            return True
     329    return False
    329330
    330331def get_language_from_request(request):
    331332    """
Back to Top