aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCarmina16 <mistresssilvara@hotmail.com>2021-03-06 22:32:26 +0700
committerFelix Queißner <felix@ib-queissner.de>2021-03-06 16:59:32 +0100
commit4e89d5d8053697cb882e659a88156eacec15dcfe (patch)
tree0228bf64cc1d7fe1baf019769ffc30d4c1c3483e /src/main.cpp
parentcdc3888b5847ee7971fef7fe296f1b483afc000b (diff)
downloadkristall-4e89d5d8053697cb882e659a88156eacec15dcfe.tar.gz
Implement interface translation
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e1098bd..bb81072 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,6 +2,7 @@
#include "kristall.hpp"
#include <QApplication>
+#include <QTranslator>
#include <QUrl>
#include <QSettings>
#include <QCommandLineParser>
@@ -384,6 +385,12 @@ int main(int argc, char *argv[])
}
});
+ QTranslator trans, qttrans;
+ qttrans.load(QLocale(), QLatin1String("qt"), "_", "/usr/local/share/qt5/translations");
+ trans.load(QLocale(), QLatin1String("kristall"), QLatin1String("_"), QLatin1String(":/i18n"));
+ app.installTranslator(&qttrans);
+ app.installTranslator(&trans);
+
{
// Initialise default fonts
#ifdef Q_OS_WIN32
@@ -406,12 +413,12 @@ int main(int argc, char *argv[])
QCommandLineOption newWindowOption {
{ "w", "new-window" },
- app.tr("Opens the provided links in a new window instead of tabs."),
+ QApplication::tr("Opens the provided links in a new window instead of tabs."),
};
QCommandLineOption isolatedOption {
{ "i", "isolated" },
- app.tr("Starts the instance of kristall as a isolated session that cannot communicate with other windows."),
+ QApplication::tr("Starts the instance of kristall as a isolated session that cannot communicate with other windows."),
};
cli_parser.addVersionOption();
@@ -419,7 +426,7 @@ int main(int argc, char *argv[])
cli_parser.addOption(newWindowOption);
cli_parser.addOption(isolatedOption);
- cli_parser.addPositionalArgument("urls", app.tr("The urls that should be opened instead of the start page"), "[urls...]");
+ cli_parser.addPositionalArgument("urls", QApplication::tr("The urls that should be opened instead of the start page"), "[urls...]");
cli_parser.process(app);