Commit 5a1468a7 authored by agriche's avatar agriche

- Take in account the system language.

parent 88f8a7bc
......@@ -183,13 +183,20 @@ UBApplication::~UBApplication()
QString UBApplication::checkLanguageAvailabilityForSankore(QString &language)
{
QStringList availableTranslations = UBPlatformUtils::availableTranslations();
//QStringList availableTranslations ;availableTranslations<< "OpenBoard_fr";
if(availableTranslations.contains(language,Qt::CaseInsensitive))
return language;
else{
if(language.length() > 2){
QString shortLanguageCode = language.left(2);
if(availableTranslations.contains(shortLanguageCode,Qt::CaseInsensitive))
return shortLanguageCode;
//if(availableTranslations.contains(shortLanguageCode,Qt::CaseInsensitive))
foreach (const QString &str, availableTranslations) {
if (str.contains(shortLanguageCode))
return shortLanguageCode;
}
//if(availableTranslations.contains(shortLanguageCode))
//return shortLanguageCode;
}
}
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