diff options
author | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2017-12-27 20:34:03 +0900 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-29 17:26:33 +0100 |
commit | 4b7d58e71e8864a90d3b567f21029968d6e8edef (patch) | |
tree | 9f25bb4a64713bef08b020d090075c5f06cc7924 /app/main.cpp | |
parent | d084bc1f764833566f3e8eafc9fc297c3fa9ee08 (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.cpp | 10 |
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); |