equal
deleted
inserted
replaced
266 QSettings settings(DataManager::instance().settingsFileName(), QSettings::IniFormat); |
266 QSettings settings(DataManager::instance().settingsFileName(), QSettings::IniFormat); |
267 settings.setIniCodec("UTF-8"); |
267 settings.setIniCodec("UTF-8"); |
268 |
268 |
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 = HWApplication::keyboardInputLocale().name(); |
271 { |
272 // QLocale::system().name() returns only "C"... |
272 cc = QLocale::system().name(); |
|
273 |
|
274 // Fallback to current input locale if "C" locale is returned |
|
275 if(cc == "C") |
|
276 cc = HWApplication::keyboardInputLocale().name(); |
|
277 } |
273 |
278 |
274 // load locale file into translator |
279 // load locale file into translator |
275 if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc))) |
280 if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc))) |
276 qWarning("Failed to install translation (%s)", qPrintable(cc)); |
281 qWarning("Failed to install translation (%s)", qPrintable(cc)); |
277 app.installTranslator(&Translator); |
282 app.installTranslator(&Translator); |