mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-04-21 21:52:03 +02:00
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
This commit is contained in:
parent
afc0423bf6
commit
bbdd68fb1d
1 changed files with 17 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue