QTfrontend/main.cpp
changeset 8882 73d6d7f27945
parent 8799 44e520374cfc
child 8918 512753ea4b1b
equal deleted inserted replaced
8880:71ed64b18540 8882:73d6d7f27945
   265 
   265 
   266     QTranslator Translator;
   266     QTranslator Translator;
   267     {
   267     {
   268         QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat);
   268         QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat);
   269         QString cc = settings.value("misc/locale", QString()).toString();
   269         QString cc = settings.value("misc/locale", QString()).toString();
   270         if(cc.isEmpty())
   270         if (cc.isEmpty())
   271             cc = QLocale::system().name();
   271             cc = HWApplication::keyboardInputLocale().name();
       
   272             // QLocale::system().name() returns only "C"...
   272 
   273 
   273         // load locale file into translator
   274         // load locale file into translator
   274         if(!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
   275         if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
   275             qWarning("Failed to install translation");
   276             qWarning("Failed to install translation (%s)", qPrintable(cc));
   276         app.installTranslator(&Translator);
   277         app.installTranslator(&Translator);
   277     }
   278     }
   278 
   279 
   279 #ifdef _WIN32
   280 #ifdef _WIN32
   280     // Win32 registry setup (used for xfire detection etc. - don't set it if we're running in "portable" mode with a custom config dir)
   281     // Win32 registry setup (used for xfire detection etc. - don't set it if we're running in "portable" mode with a custom config dir)