Commit c8683edd authored by Stefan Gerlach's avatar Stefan Gerlach

[locale] Show actually used language in about dialog when changed in 'switch application language'

parent 6b6fb4a6
......@@ -26,6 +26,19 @@
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#include "MainWin.h"
#include "backend/core/AbstractColumn.h"
#include "backend/lib/macros.h"
#include <KAboutData>
#include <KColorSchemeManager>
#include <KConfigGroup>
#include <kconfigwidgets_version.h>
#include <KCrash>
#include <KLocalizedString>
#include <KMessageBox>
#include <KSharedConfig>
#include <QApplication>
#include <QCommandLineParser>
#include <QDir>
......@@ -34,23 +47,12 @@
#include <QStandardPaths>
#include <QModelIndex>
#include <QSysInfo>
#include <QSettings>
#ifdef _WIN32
#include <windows.h>
#endif
#include <KAboutData>
#include <KColorSchemeManager>
#include <KConfigGroup>
#include <kconfigwidgets_version.h>
#include <KCrash>
#include <KLocalizedString>
#include <KMessageBox>
#include <KSharedConfig>
#include "MainWin.h"
#include "backend/core/AbstractColumn.h"
#include "backend/lib/macros.h"
/*
* collect all system info to show in About dialog
*/
......@@ -83,11 +85,19 @@ const QString getSystemInfo() {
+ i18n("Positive/Negative sign ") + '\'' + QString(numberLocale.positiveSign()) + '\''
+ '/' + '\'' + QString(numberLocale.negativeSign()) + '\'' };
// get language set in 'switch language'
const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
QSettings languageoverride(configPath + QStringLiteral("/klanguageoverridesrc"), QSettings::IniFormat);
languageoverride.beginGroup(QStringLiteral("Language"));
QString usedLocale = languageoverride.value(qAppName(), "").toString(); // something like "en_US"
if (!usedLocale.isEmpty())
locale = QLocale(usedLocale);
QString usedLanguage = QLocale::languageToString(locale.language()) + ',' + QLocale::countryToString(locale.country());
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()) + ' ' + numberSystemInfo + '\n'
+ i18n("Locale: ") + usedLanguage + ' ' + numberSystemInfo + '\n'
+ i18n("Number settings:") + numberLocaleInfo + QLatin1String(" (") + i18n("Updated on restart") + ')' + '\n'
+ i18n("Architecture: ") + QSysInfo::buildAbi() + '\n'
+ i18n("Kernel: ") + QSysInfo::kernelType() + ' ' + QSysInfo::kernelVersion() + '\n'
......
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