diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-06-25 22:36:16 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-06-26 16:14:25 +0200 |
commit | 2943f608110f93a7c44150dd26de076c8a822c98 (patch) | |
tree | 3f9960dbde08b0f2da0ca23898de3020ab45e101 /src/qt/optionsdialog.cpp | |
parent | 8a6ea5d687561c0e94e05e5aa12c2f9832f2e9d2 (diff) |
GUI: change language selection format
- display as "language - country (locale name)", when locale name consists of 2 parts
- display as "language (locale name)", when locale name consists of 1 part
Diffstat (limited to 'src/qt/optionsdialog.cpp')
-rw-r--r-- | src/qt/optionsdialog.cpp | 15 |
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)); |