aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a419775..85bf5f0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -14,6 +14,8 @@
#include <iostream>
#include "plugin.h"
#include "session.h"
+#include <QTranslator>
+#include <QLibraryInfo>
int main(int argc, char **argv)
{
@@ -83,6 +85,24 @@ int main(int argc, char **argv)
app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
app.setConfiguration(config);
+ // translator
+ if(config->exists("browser.locale")) {
+ auto *translator = new QTranslator(&app);
+ if(translator->load("qt_" + config->value<QString>("browser.locale").value(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+ app.installTranslator(translator);
+ else
+ delete translator;
+ }
+
+ if(config->exists("browser.translation")) {
+ auto *translator = new QTranslator(&app);
+ if(translator->load(config->value<QString>("browser.translation").value()))
+ app.installTranslator(translator);
+ else
+ delete translator;
+ }
+
+
app.setup(QString::fromStdString(config->value<std::string>("profile.default").value()));
for(const Plugin &plugin : plugins) {
app.registerPlugin(plugin);