Skip to content
Snippets Groups Projects
Commit bbdd68fb authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

misc: fix isRTL function

Uses the system locale name when the preference is set to "SYSTEM".
Adds some extra ISO 639-1 RTL languages.

Change-Id: Ia28ae1bc15992ce26f88ab11bc447d76054f0581
parent afc0423b
No related branches found
No related tags found
No related merge requests found
......@@ -799,8 +799,23 @@ bool
UtilsAdapter::isRTL()
{
auto pref = getAppValue(Settings::Key::LANG).toString();
pref == "SYSTEM" ? QLocale::system().name() : pref;
return pref == "ar" || pref == "he" || pref == "fa" || pref == "ur";
pref = pref == "SYSTEM" ? QLocale::system().name() : pref;
static const QStringList rtlLanguages {
// as defined by ISO 639-1
"ar", // Arabic
"he", // Hebrew
"fa", // Persian (Farsi)
"ur", // Urdu
"ps", // Pashto
"ku", // Kurdish
"sd", // Sindhi
"dv", // Dhivehi (Maldivian)
"yi", // Yiddish
"am", // Amharic
"ti", // Tigrinya
"kk" // Kazakh (in Arabic script)
};
return rtlLanguages.contains(pref);
}
bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment