From 81ccec40424c725d816c447dce78b74709991687 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 13 Jul 2012 07:43:41 +0200 Subject: [PATCH] enhance lang-selection in OptionsDialog, when compiling with Qt >= 4.8 --- src/qt/optionsdialog.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index e28b96b0906..5f39c7814d7 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -68,13 +68,23 @@ OptionsDialog::OptionsDialog(QWidget *parent) : /** check if the locale name consists of 2 parts (language_country) */ if(langStr.contains("_")) { +#if QT_VERSION >= 0x040800 + /** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */ + ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); +#else /** 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)); +#endif } else { +#if QT_VERSION >= 0x040800 + /** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */ + ui->lang->addItem(locale.nativeLanguageName() + 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)); +#endif } }