BIDI language detection not smart enough
|Reported by:||Ahmad Alhashemi||Owned by:||Jannis Leidel|
|Severity:||Keywords:||bidi rtl sprintdec01|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
one of my projects, I'm using a LANGUAGE_CODE of 'ar-kw' (Arabic-Kuwait). We already have an Arabic translation (ar) and it is being appropriately used. The problem is that my language code is not being detected as a right to left language. It has to be exactly 'ar' or it will not be detected.
Maybe we can bring some of the smartness of gettext into detecting the direction of text too?
There is a function in gettext called _expand_lang. It takes the locale as a single argument and returns a list of possible names for this locale, so that ar_KW will return a list containing ar_KW, ar and other locales.