Ticket #4389: bidi.diff

File bidi.diff, 902 bytes (added by Jannis Leidel, 17 years ago)

Added proposed support for _expand_lang

  • django/utils/translation/trans_real.py

     
    237237    from django.conf import settings
    238238    return settings.LANGUAGE_CODE
    239239
     240def get_possible_language_names():
     241    "Returns a list of possible names for the given language"
     242    return gettext_module._expand_lang(to_locale(get_language()))
     243
    240244def get_language_bidi():
    241245    """
    242246    Returns selected language's BiDi layout.
     
    244248    True = right-to-left layout
    245249    """
    246250    from django.conf import settings
    247     return get_language() in settings.LANGUAGES_BIDI
     251    for language in get_possible_language_names():
     252        if language in settings.LANGUAGES_BIDI:
     253            return True
     254    return False
    248255
    249256def catalog():
    250257    """
Back to Top