improve translations loading
parent
dbe793a471
commit
85ed418c3e
|
|
@ -78,10 +78,14 @@ int main(int argc, char *argv[])
|
|||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
application.installTranslator(&qtTranslator);
|
||||
|
||||
QTranslator meaTranslator;
|
||||
qDebug() << "Loading translation file:" << ":/translations/nymea-app-" + QLocale::system().name();
|
||||
meaTranslator.load(":/translations/nymea-app-" + QLocale::system().name());
|
||||
application.installTranslator(&meaTranslator);
|
||||
QTranslator appTranslator;
|
||||
bool translationResult = appTranslator.load(QLocale(), "nymea-app", "-", ":/translations/", ".qm");
|
||||
if (translationResult) {
|
||||
qDebug() << "Loaded translation for locale" << QLocale();
|
||||
} else {
|
||||
qWarning() << "Failed to load translations for locale" << QLocale();
|
||||
}
|
||||
application.installTranslator(&appTranslator);
|
||||
|
||||
qDebug() << "Running on" << QSysInfo::machineHostName() << QSysInfo::prettyProductName() << QSysInfo::productType() << QSysInfo::productVersion();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ SOURCES += main.cpp \
|
|||
|
||||
RESOURCES += resources.qrc \
|
||||
ruletemplates.qrc \
|
||||
images.qrc
|
||||
images.qrc \
|
||||
translations.qrc
|
||||
equals(STYLES_PATH, "") {
|
||||
RESOURCES += styles.qrc
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -129,8 +129,6 @@
|
|||
<file>ui/fonts/Ubuntu-R.ttf</file>
|
||||
<file>ui/fonts/Ubuntu-RI.ttf</file>
|
||||
<file>qtquickcontrols2.conf</file>
|
||||
<file>translations/nymea-app-de_DE.qm</file>
|
||||
<file>translations/nymea-app-en_US.qm</file>
|
||||
<file>../LICENSE</file>
|
||||
<file>ui/customviews/GenericTypeGraphPre110.qml</file>
|
||||
<file>ui/customviews/GenericTypeGraph.qml</file>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>translations</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
Loading…
Reference in New Issue