- Take in account the system language.

preferencesAboutTextFull
agriche 9 years ago
parent 88f8a7bc5b
commit 5a1468a77a
  1. 9
      src/core/UBApplication.cpp

@ -183,14 +183,21 @@ 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))
//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("");
}

Loading…
Cancel
Save