mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Allow setting UI language from commandline (implements #678)
This commit is contained in:
@@ -162,11 +162,13 @@ int main(int argc, char *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
|
||||
// - Then load the more specific locale translator
|
||||
QString lang_territory = QLocale::system().name(); // "en_US"
|
||||
QString lang = lang_territory;
|
||||
|
||||
lang.truncate(lang_territory.lastIndexOf('_')); // "en"
|
||||
QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user