summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qt.io>2017-12-27 20:34:03 +0900
committerLoïc Collignon <loic.collignon@iot.bzh>2018-01-04 14:20:15 +0100
commit8363df0356c20c92f6dae175b3c8b83b1032e6ff (patch)
treec15dba596f92dd4d5440c0b798255d64251342c3 /app/main.cpp
parentb7cfcddf4b89d73a4d5e5e854421219c50bf1f9e (diff)
Add basic translation support
Added French and Japanese translations Change-Id: I58eca5ffaad2367a4dd26b6472bdbcd45c957061 Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/main.cpp b/app/main.cpp
index b793ef3..211f52b 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -22,6 +22,8 @@
#include <QtQml/QQmlContext>
#include <QtQuick/QQuickWindow>
+#include "translator.h"
+
#ifdef HAVE_LIBHOMESCREEN
#include <libhomescreen.hpp>
#endif
@@ -46,13 +48,17 @@ int main(int argc, char *argv[])
parser.process(app);
QStringList positionalArguments = parser.positionalArguments();
+ qmlRegisterType<Translator>("Translator", 1, 0, "Translator");
+
QQmlApplicationEngine engine;
QQmlContext *context = engine.rootContext();
QUrl bindingAddress;
+ int port;
+ QString secret;
if (positionalArguments.length() == 2) {
- int port = positionalArguments.takeFirst().toInt();
- QString secret = positionalArguments.takeFirst();
+ port = positionalArguments.takeFirst().toInt();
+ secret = positionalArguments.takeFirst();
bindingAddress.setScheme(QStringLiteral("ws"));
bindingAddress.setHost(QStringLiteral("localhost"));
bindingAddress.setPort(port);