Ticket #4389: get_language_bidi.diff

File get_language_bidi.diff, 523 bytes (added by arien, 7 years ago)

Use only first part of language name (i.e., xx for a language xx-yy) for BiDi detection.

  • django/utils/translation/trans_real.py

     
    244244    True = right-to-left layout
    245245    """
    246246    from django.conf import settings
    247     return get_language() in settings.LANGUAGES_BIDI
     247    base_lang = lambda x: x.split('-', 1)[0]
     248    return base_lang(get_language()) in settings.LANGUAGES_BIDI
    248249
    249250def catalog():
    250251    """
Back to Top