diff options
-rw-r--r-- | locales/bin/de_DE.qm | bin | 0 -> 550 bytes | |||
-rw-r--r-- | locales/bin/es_ES.qm | bin | 0 -> 574 bytes | |||
-rw-r--r-- | locales/bin/main_en.qm | bin | 0 -> 310 bytes | |||
-rw-r--r-- | locales/de_DE.ts | 36 | ||||
-rw-r--r-- | locales/es_ES.ts | 34 | ||||
-rw-r--r-- | locales/main_en.ts | 34 | ||||
-rw-r--r-- | main.cpp | 13 | ||||
-rw-r--r-- | qml.qrc | 4 |
8 files changed, 121 insertions, 0 deletions
diff --git a/locales/bin/de_DE.qm b/locales/bin/de_DE.qm Binary files differnew file mode 100644 index 0000000..6afd413 --- /dev/null +++ b/locales/bin/de_DE.qm diff --git a/locales/bin/es_ES.qm b/locales/bin/es_ES.qm Binary files differnew file mode 100644 index 0000000..5eb76d5 --- /dev/null +++ b/locales/bin/es_ES.qm diff --git a/locales/bin/main_en.qm b/locales/bin/main_en.qm Binary files differnew file mode 100644 index 0000000..8a9ba24 --- /dev/null +++ b/locales/bin/main_en.qm diff --git a/locales/de_DE.ts b/locales/de_DE.ts new file mode 100644 index 0000000..a7e8454 --- /dev/null +++ b/locales/de_DE.ts @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="de_DE"> +<context> + <name>main</name> + <message> + <location filename="../main.qml" line="12"/> + <source>Remote Support for your Desktop</source> + <translatorcomment>Just the titel of the window</translatorcomment> + <translation>Fernwartung für den Desktop</translation> + </message> + <message> + <location filename="../main.qml" line="17"/> + <source>Unknown state of service</source> + <translatorcomment>DBUS service state</translatorcomment> + <translation>Unbekannter Status des Dienstes</translation> + </message> + <message> + <location filename="../main.qml" line="45"/> + <source>Allow remote desktop support</source> + <translation>Desktop zur Fernwartung freigeben</translation> + </message> + <message> + <location filename="../main.qml" line="68"/> + <source>Access pin to this computer</source> + <translation>Zugangspin zu diesem Computer</translation> + </message> + <message> + <location filename="../main.qml" line="89"/> + <source>%1</source> + <extracomment>Do not translate!</extracomment> + <translation></translation> + <extra-This>is just the pin which is used to authenticate to remote web app (django) frontend</extra-This> + </message> +</context> +</TS> diff --git a/locales/es_ES.ts b/locales/es_ES.ts new file mode 100644 index 0000000..e58d9fd --- /dev/null +++ b/locales/es_ES.ts @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="es_ES"> +<context> + <name>main</name> + <message> + <location filename="../main.qml" line="12"/> + <source>Remote Support for your Desktop</source> + <translation>Soporte remoto para su escritorio</translation> + </message> + <message> + <location filename="../main.qml" line="17"/> + <source>Unknown state of service</source> + <translation>Estado de servicio desconocido</translation> + </message> + <message> + <location filename="../main.qml" line="45"/> + <source>Allow remote desktop support</source> + <translation>Permitir soporte de escritorio remoto</translation> + </message> + <message> + <location filename="../main.qml" line="68"/> + <source>Access pin to this computer</source> + <translation>Pin de acceso a esta computadora</translation> + </message> + <message> + <location filename="../main.qml" line="89"/> + <source>%1</source> + <extracomment>Do not translate!</extracomment> + <translation></translation> + <extra-This>is just the pin which is used to authenticate to remote web app (django) frontend</extra-This> + </message> +</context> +</TS> diff --git a/locales/main_en.ts b/locales/main_en.ts new file mode 100644 index 0000000..07d13c9 --- /dev/null +++ b/locales/main_en.ts @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="en_US"> +<context> + <name>main</name> + <message> + <location filename="../main.qml" line="12"/> + <source>Remote Support for your Desktop</source> + <translation></translation> + </message> + <message> + <location filename="../main.qml" line="17"/> + <source>Unknown state of service</source> + <translation></translation> + </message> + <message> + <location filename="../main.qml" line="45"/> + <source>Allow remote desktop support</source> + <translation></translation> + </message> + <message> + <location filename="../main.qml" line="68"/> + <source>Access pin to this computer</source> + <translation></translation> + </message> + <message> + <location filename="../main.qml" line="89"/> + <source>%1</source> + <extracomment>Do not translate!</extracomment> + <translation></translation> + <extra-This>is just the pin which is used to authenticate to remote web app (django) frontend</extra-This> + </message> +</context> +</TS> @@ -1,5 +1,7 @@ #include <QGuiApplication> #include <QQmlApplicationEngine> +#include <QTranslator> +#include <QDebug> int main(int argc, char *argv[]) { @@ -7,6 +9,17 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); + + QTranslator translator; + + qDebug() << "Im about to load: :/locales/bin/" + QLocale::system().name() + " locale!"; + if(translator.load(":/locales/bin/" + QLocale::system().name())) { + app.installTranslator(&translator); + qDebug() << "Loaded: " + QLocale::system().name() + " locale!"; + } else { + qDebug() << "Unable to load translation"; + } + QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) @@ -2,5 +2,9 @@ <qresource prefix="/"> <file>main.qml</file> <file>main.cpp</file> + <file>locales/bin/de_DE.qm</file> + <file>locales/bin/main_en.qm</file> + <file>locales/de_DE.ts</file> + <file>locales/main_en.ts</file> </qresource> </RCC> |