aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-06-27 03:37:33 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2012-06-27 03:37:33 -0700
commitbcf0f4117124b2fc070472fb378d5115b7397ea4 (patch)
treeb97ec974c53e4ac998410cfa81d05e5a9bf631d8
parenta95a0ab5693e54343dc68adb704154a5af9e6186 (diff)
parent2943f608110f93a7c44150dd26de076c8a822c98 (diff)
Merge pull request #1519 from Diapolo/GUI_locale_selection
GUI: change language selection format to "language - country (locale name)"
-rw-r--r--src/qt/optionsdialog.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 9c7b85451c..e28b96b090 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -14,6 +14,7 @@
#include <QIntValidator>
#include <QLabel>
#include <QLineEdit>
+#include <QLocale>
#include <QMessageBox>
#include <QPushButton>
#include <QRegExp>
@@ -62,7 +63,19 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
foreach(const QString &langStr, translations.entryList())
{
- ui->lang->addItem(langStr, QVariant(langStr));
+ QLocale locale(langStr);
+
+ /** check if the locale name consists of 2 parts (language_country) */
+ if(langStr.contains("_"))
+ {
+ /** display language strings as "language - country (locale name)", e.g. "German - Germany (de)" */
+ ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" - ") + QLocale::countryToString(locale.country()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
+ }
+ else
+ {
+ /** display language strings as "language (locale name)", e.g. "German (de)" */
+ ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
+ }
}
ui->unit->setModel(new BitcoinUnits(this));