|
|
@ -162,11 +162,13 @@ int main(int argc, char *argv[]) |
|
|
|
|
|
|
|
|
|
|
|
ParseParameters(argc, argv); |
|
|
|
ParseParameters(argc, argv); |
|
|
|
|
|
|
|
|
|
|
|
// Load language files for system locale:
|
|
|
|
// Get desired locale ("en_US") from command line or system locale
|
|
|
|
|
|
|
|
QString lang_territory = QString::fromStdString(GetArg("-lang", QLocale::system().name().toStdString())); |
|
|
|
|
|
|
|
// Load language files for configured locale:
|
|
|
|
// - First load the translator for the base language, without territory
|
|
|
|
// - First load the translator for the base language, without territory
|
|
|
|
// - Then load the more specific locale translator
|
|
|
|
// - Then load the more specific locale translator
|
|
|
|
QString lang_territory = QLocale::system().name(); // "en_US"
|
|
|
|
|
|
|
|
QString lang = lang_territory; |
|
|
|
QString lang = lang_territory; |
|
|
|
|
|
|
|
|
|
|
|
lang.truncate(lang_territory.lastIndexOf('_')); // "en"
|
|
|
|
lang.truncate(lang_territory.lastIndexOf('_')); // "en"
|
|
|
|
QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator; |
|
|
|
QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator; |
|
|
|
|
|
|
|
|
|
|
|