Commit b65f506a authored by Stefan Gerlach's avatar Stefan Gerlach

[locale] show current number locale in about dialog

parent dc16327e
......@@ -61,27 +61,28 @@ const QString getSystemInfo() {
#else
const QString buildType(i18n("Debug build"));
#endif
const QLocale locale;
const QString localeInfo{QLatin1String(" (")
+ i18n("Decimal point: ") + '\'' + QString(locale.decimalPoint())
SET_NUMBER_LOCALE
const QString numberLocaleInfo{ ' '
+ i18n("Decimal point ") + '\'' + QString(numberLocale.decimalPoint())
+ QLatin1String("\', ")
+ i18n("Group separator: ") + '\'' + QString(locale.groupSeparator())
+ i18n("Group separator ") + '\'' + QString(numberLocale.groupSeparator())
+ QLatin1String("\', ")
+ i18n("Exponential: ") + '\'' + QString(locale.exponential())
+ i18n("Exponential ") + '\'' + QString(numberLocale.exponential())
+ QLatin1String("\', ")
+ i18n("Zero digit: ") + '\'' + QString(locale.zeroDigit())
+ i18n("Zero digit: ") + '\'' + QString(numberLocale.zeroDigit())
+ QLatin1String("\', ")
+ i18n("Percent: ") + '\'' + QString(locale.percent())
+ i18n("Percent: ") + '\'' + QString(numberLocale.percent())
+ QLatin1String("\', ")
+ i18n("Positive/Negative sign: ") + '\'' + QString(locale.positiveSign()) + '\''
+ '/' + '\'' + QString(locale.negativeSign())
+ QLatin1String("\')")};
+ i18n("Positive/Negative sign: ") + '\'' + QString(numberLocale.positiveSign()) + '\''
+ '/' + '\'' + QString(numberLocale.negativeSign()) };
QLocale locale;
return buildType + '\n'
+ QString("%1, %2").arg(__DATE__).arg(__TIME__) + '\n'
+ i18n("System: ") + QSysInfo::prettyProductName() + '\n'
+ i18n("Locale: ") + QLocale::languageToString(locale.language()) + ','
+ QLocale::countryToString(locale.country()) + localeInfo + '\n'
+ QLocale::countryToString(locale.country()) + '\n'
+ i18n("Number settings:") + numberLocaleInfo + '\n'
+ i18n("Architecture: ") + QSysInfo::buildAbi() + '\n'
+ i18n("Kernel: ") + QSysInfo::kernelType() + ' ' + QSysInfo::kernelVersion() + '\n'
+ i18n("C++ Compiler: ") + QString(CXX_COMPILER) + '\n'
......
......@@ -58,7 +58,11 @@ SettingsGeneralPage::SettingsGeneralPage(QWidget* parent) : SettingsPage(parent)
}
SettingsGeneralPage::DecimalSeparator SettingsGeneralPage::decimalSeparator(QLocale locale) {
DEBUG("SettingsGeneralPage::decimalSeparator()")
DEBUG(" LOCALE: " << STDSTRING(locale.name()))
DEBUG(" LOCALE LANG: " << locale.language())
QChar decimalPoint{locale.decimalPoint()};
DEBUG(" SEPARATING CHAR: " << STDSTRING(QString(decimalPoint)) )
if (decimalPoint == QChar('.'))
return DecimalSeparator::Dot;
else if (decimalPoint == QChar(','))
......@@ -69,6 +73,10 @@ SettingsGeneralPage::DecimalSeparator SettingsGeneralPage::decimalSeparator(QLoc
QLocale::Language SettingsGeneralPage::decimalSeparatorLocale() const {
int currentIndex = ui.cbDecimalSeparator->currentIndex();
DEBUG(" SYSTEM LOCALE: " << STDSTRING(QLocale().name()))
DEBUG(" SYSTEM LOCALE LANG: " << QLocale().language())
DEBUG(" CURRENT SEPARATING CHAR: " << STDSTRING(QString(QLocale().decimalPoint())) )
DEBUG(" GERMAN SEPARATING CHAR: " << STDSTRING(QString(QLocale(QLocale::Language::German).decimalPoint())) )
if (currentIndex == static_cast<int>(decimalSeparator())) // system decimal separator selected
return QLocale().language();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment