Commit 5a1468a7 authored by agriche's avatar agriche

- Take in account the system language.

parent 88f8a7bc
...@@ -183,14 +183,21 @@ UBApplication::~UBApplication() ...@@ -183,14 +183,21 @@ UBApplication::~UBApplication()
QString UBApplication::checkLanguageAvailabilityForSankore(QString &language) QString UBApplication::checkLanguageAvailabilityForSankore(QString &language)
{ {
QStringList availableTranslations = UBPlatformUtils::availableTranslations(); QStringList availableTranslations = UBPlatformUtils::availableTranslations();
//QStringList availableTranslations ;availableTranslations<< "OpenBoard_fr";
if(availableTranslations.contains(language,Qt::CaseInsensitive)) if(availableTranslations.contains(language,Qt::CaseInsensitive))
return language; return language;
else{ else{
if(language.length() > 2){ if(language.length() > 2){
QString shortLanguageCode = language.left(2); QString shortLanguageCode = language.left(2);
if(availableTranslations.contains(shortLanguageCode,Qt::CaseInsensitive)) //if(availableTranslations.contains(shortLanguageCode,Qt::CaseInsensitive))
foreach (const QString &str, availableTranslations) {
if (str.contains(shortLanguageCode))
return shortLanguageCode; return shortLanguageCode;
} }
//if(availableTranslations.contains(shortLanguageCode))
//return shortLanguageCode;
}
} }
return QString(""); return QString("");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment