From b5240a5eb5131378a35fff2aa7543a5cf93b4eb0 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Wed, 22 Jun 2016 22:51:07 +0200 Subject: [PATCH] Even better lang loading. --- src/miscellaneous/localization.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/miscellaneous/localization.cpp b/src/miscellaneous/localization.cpp index 51b6eceea..aefbab9cc 100755 --- a/src/miscellaneous/localization.cpp +++ b/src/miscellaneous/localization.cpp @@ -33,15 +33,7 @@ Localization::~Localization() { } QString Localization::desiredLanguage() const { - QString from_settings = qApp->settings()->value(GROUP(General), SETTING(General::Language)).toString(); - - foreach (Language lang, installedLanguages()) { - if (lang.m_code == from_settings) { - return from_settings; - } - } - - return DEFAULT_LOCALE; + return qApp->settings()->value(GROUP(General), SETTING(General::Language)).toString(); } void Localization::loadActiveLanguage() { @@ -52,6 +44,7 @@ void Localization::loadActiveLanguage() { if (app_translator->load(QLocale(desired_localization), "rssguard", QSL("-"), APP_LANG_PATH)) { Application::installTranslator(app_translator); qDebug("Application localization '%s' loaded successfully.", qPrintable(desired_localization)); + desired_localization = app_translator->translate("QObject", "LANG_ABBREV"); } else { qWarning("Application localization '%s' was not loaded.", qPrintable(desired_localization));