summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-09-03 19:23:45 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-09-11 17:21:40 +0300
commitbdd4d3cbe99a4859af8c780f7aae2eef5cd8c18c (patch)
tree21c389992d0ed09cc28a2a640023b23b06fed75d /src
parentUpdate cppcheck.sh (diff)
downloadrekonq-RKNQ-27-linguist.tar.xz
Add translations to CMakeListsRKNQ-27-linguist
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp12
-rw-r--r--src/main.cpp4
2 files changed, 14 insertions, 2 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 38ad7477..bdef20dd 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -18,6 +18,7 @@
#include <QDir>
#include <QPluginLoader>
#include <QStandardPaths>
+#include <QTranslator>
#include <spdlog/spdlog.h>
// ---------------------------------------------------------------------------------------------------------------
@@ -34,6 +35,17 @@ Application::Application(int &argc, char *argv[]) : SingleApplication(argc, argv
spdlog::info("Loading rekonq configuration: {}", qUtf8Printable(settingsPath));
m_settings = new Settings(settingsPath, this);
+ // set localization
+ QLocale locale;
+ spdlog::info("Current locale: {}", qUtf8Printable(QLocale::territoryToString(locale.territory())));
+ auto *translator = new QTranslator(this);
+ if (translator->load(locale, QL1S("rekonq"), QL1S("_"), QL1S(":/i18n"))) {
+ QCoreApplication::installTranslator(translator);
+ spdlog::info("Installed translations for locale");
+ }
+ else
+ delete translator;
+
if (m_settings->value("FirstRun").toBool()) {
spdlog::info("First run");
if ((new SettingsDialog(m_settings, nullptr))->exec()) spdlog::info("Settings saved");
diff --git a/src/main.cpp b/src/main.cpp
index a537be8b..0dedacea 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,8 +31,8 @@ int main(int argc, char **argv)
app.sendMessage(Application::arguments().join('\n').toUtf8());
return 0;
}
- else
- app.parseCommandLine(app.instanceId(), {});
+
+ app.parseCommandLine(app.instanceId(), {});
/*