Commit 49597f72 authored by Martin Höher's avatar Martin Höher

Added German translations

Added German translations. In additions, translations are now loaded
when the app starts. When no translation is found, the standard ("C")
one is used.
parent 28dafedc
Pipeline #16341018 passed with stages
in 11 minutes and 13 seconds
......@@ -44,7 +44,7 @@ Page {
}
Label {
text: qsTr("(c) RPdev 2013-2016, version %1").arg(applicationVersion)
text: qsTr("(c) RPdev 2013-2018, version %1").arg(applicationVersion)
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width
}
......
......@@ -10,7 +10,8 @@ CONFIG += c++11
SOURCES += main.cpp
RESOURCES += qml.qrc \
res.qrc
res.qrc \
translations.qrc
!ios&!android {
DEFINES += OTL_USE_SINGLE_APPLICATION
......@@ -63,3 +64,12 @@ contains(ANDROID_TARGET_ARCH,x86) {
$$PWD/../pre-build/android/openssl/x86-4.9-api-18/libcrypto.so \
$$PWD/../pre-build/android/openssl/x86-4.9-api-18/libssl.so
}
# Add QML/JS files when running lupdate:
lupdate_only {
SOURCES += $$files(*.qml,true) $$files(*.js,true)
}
TRANSLATIONS += \
translations/opentodolist_en.ts \
translations/opentodolist_de.ts
......@@ -9,10 +9,12 @@
#include <QFont>
#include <QFontInfo>
#include <QIcon>
#include <QLocale>
#include <QLoggingCategory>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QScreen>
#include <QTranslator>
#ifdef OTL_USE_SINGLE_APPLICATION
#include <QtSingleApplication>
......@@ -138,6 +140,19 @@ int main(int argc, char *argv[])
app.setAttribute(Qt::AA_EnableHighDpiScaling);
QTranslator translator;
// look up e.g. :/translations/myapp_de.qm
if (translator.load(QLocale(),
QLatin1String("opentodolist"),
QLatin1String("_"),
QLatin1String(":/translations"),
".qm")) {
qDebug() << "Found translation for" << QLocale().bcp47Name();
app.installTranslator(&translator);
} else {
qDebug() << "No translation for" << QLocale().bcp47Name();
}
QCoreApplication::setApplicationName("OpenTodoList");
QCoreApplication::setApplicationVersion(VERSION);
QCoreApplication::setOrganizationDomain("www.rpdev.net");
......
<RCC>
<qresource prefix="/">
<file>translations/opentodolist_de.qm</file>
<file>translations/opentodolist_en.qm</file>
</qresource>
</RCC>
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment