@@ -1,5 +1,5 @@
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -26,6 +26,9 @@
26#include <QQmlContext>
26#include <QQmlContext>
27#include <QQmlEngine>
27#include <QQmlEngine>
28#include <QDebug>
28#include <QDebug>
29+#include <QTranslator>
30+#include <QLibraryInfo>
30IndicatorsClient::IndicatorsClient(int &argc, char **argv)
33IndicatorsClient::IndicatorsClient(int &argc, char **argv)
31 : QObject(0),
34 : QObject(0),
@@ -33,6 +36,11 @@ IndicatorsClient::IndicatorsClient(int &argc, char **argv)
34 m_application = new QApplication(argc, argv);
37 m_application = new QApplication(argc, argv);
39+ QTranslator qtTranslator;
40+ if (qtTranslator.load(QLocale(), QStringLiteral("qt_"), qgetenv("SNAP"), QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
41+ m_application->installTranslator(&qtTranslator);
36 QStringList args = m_application->arguments();
44 QStringList args = m_application->arguments();
38 m_view = new QQuickView;
46 m_view = new QQuickView;
@@ -53,8 +61,7 @@ IndicatorsClient::IndicatorsClient(int &argc, char **argv)
53 if (geometryArg.size() == 2) {
61 if (geometryArg.size() == 2) {
54 m_view->resize(geometryArg.at(0).toInt(), geometryArg.at(1).toInt());
62 m_view->resize(geometryArg.at(0).toInt(), geometryArg.at(1).toInt());
58 //Usable size on desktop
65 //Usable size on desktop
59 m_view->setMinimumSize(QSize(480, 720));
66 m_view->setMinimumSize(QSize(480, 720));
@@ -69,11 +76,6 @@ IndicatorsClient::~IndicatorsClient()
69 delete m_application;
76 delete m_application;
72−void IndicatorsClient::setupUI()
77int IndicatorsClient::run()
79int IndicatorsClient::run()
79 m_view->show();
81 m_view->show();