fixed issue related to translation loading

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent c72b6dc69b
commit 5a434ba667
  1. 17
      src/core/UBApplication.cpp

@ -216,14 +216,17 @@ QString UBApplication::checkLanguageAvailabilityForSankore(QString &language)
void UBApplication::setupTranslators(QStringList args) void UBApplication::setupTranslators(QStringList args)
{ {
QString forcedLanguage; QString forcedLanguage("");
if(args.contains("-lang")) if(args.contains("-lang"))
forcedLanguage=args.at(args.indexOf("-lang") + 1); forcedLanguage=args.at(args.indexOf("-lang") + 1);
else{ // TODO claudio: this has been commented because some of the translation seem to be loaded at this time
QString setLanguage = UBSettings::settings()->appPreferredLanguage->get().toString(); // especially tools name. This is a workaround and we have to be able to load settings without
if(!setLanguage.isEmpty()) // impacting the translations
forcedLanguage = setLanguage; // else{
} // QString setLanguage = UBSettings::settings()->appPreferredLanguage->get().toString();
// if(!setLanguage.isEmpty())
// forcedLanguage = setLanguage;
// }
QString language(""); QString language("");
@ -242,7 +245,6 @@ void UBApplication::setupTranslators(QStringList args)
else{ else{
mApplicationTranslator = new QTranslator(this); mApplicationTranslator = new QTranslator(this);
mQtGuiTranslator = new QTranslator(this); mQtGuiTranslator = new QTranslator(this);
mApplicationTranslator->load(UBPlatformUtils::translationPath(QString("sankore_"),language)); mApplicationTranslator->load(UBPlatformUtils::translationPath(QString("sankore_"),language));
installTranslator(mApplicationTranslator); installTranslator(mApplicationTranslator);
@ -256,7 +258,6 @@ void UBApplication::setupTranslators(QStringList args)
} }
if(!qtGuiTranslationPath.isEmpty()){ if(!qtGuiTranslationPath.isEmpty()){
qDebug() << "qtGuiTranslationPath " << qtGuiTranslationPath;
mQtGuiTranslator->load(qtGuiTranslationPath); mQtGuiTranslator->load(qtGuiTranslationPath);
installTranslator(mQtGuiTranslator); installTranslator(mQtGuiTranslator);
} }

Loading…
Cancel
Save