QTfrontend/main.cpp
branchqt5transition
changeset 13182 d2f8dafdb080
parent 13180 3961f9d0c7e4
child 13188 16b375b21af1
equal deleted inserted replaced
13181:2148b493836e 13182:d2f8dafdb080
   353 
   353 
   354             // Fallback to current input locale if "C" locale is returned
   354             // Fallback to current input locale if "C" locale is returned
   355             if(cc == "C")
   355             if(cc == "C")
   356                 cc = HWApplication::inputMethod()->locale().name();
   356                 cc = HWApplication::inputMethod()->locale().name();
   357         }
   357         }
       
   358         qDebug("Frontend uses locale: %s", qPrintable(cc));
   358 
   359 
   359         // Load locale files into translators
   360         // Load locale files into translators
   360         if (!TranslatorHedgewars.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
   361         if (!TranslatorHedgewars.load(QString("hedgewars_%1").arg(cc), QString("physfs://Locale")))
   361             qWarning("Failed to install Hedgewars translation (%s)", qPrintable(cc));
   362             qWarning("Failed to install Hedgewars translation (%s)", qPrintable(cc));
   362         if (!TranslatorQt.load(QString("%1/qt_%2").arg(QLibraryInfo::location(QLibraryInfo::TranslationsPath), cc)))
   363         if (!TranslatorQt.load(QString("qt_%1").arg(cc), QString(QLibraryInfo::location(QLibraryInfo::TranslationsPath))))
   363             qWarning("Failed to install Qt translation (%s)", qPrintable(cc));
   364             qWarning("Failed to install Qt translation (%s)", qPrintable(cc));
   364         app.installTranslator(&TranslatorHedgewars);
   365         app.installTranslator(&TranslatorHedgewars);
   365         app.installTranslator(&TranslatorQt);
   366         app.installTranslator(&TranslatorQt);
   366         app.setLayoutDirection(QLocale(cc).textDirection());
   367         app.setLayoutDirection(QLocale(cc).textDirection());
   367     }
   368     }