QT Translate on Android
-
So are you sure the file exists(the one with translation)? Can you check it @QFile::exists()@
Are you installing translator properly?
@QLocale::setDefault(QLocale::English);
qtTranslator.load(":/tr/translations_en.qm");
app.installTranslator(&qtTranslator);@ -
Meanwhile ...
My code in main looks like this;
QTranslator translator;
if(translator.load(":/xxx.qm") != 1) { ...}And my resource file like this:
<RCC>
<qresource>
<file alias="xxx.qm">tr/xxx_en.qm</file>
</qresource>
<qresource lang="sv">
<file alias="xxx.qm">tr/xxx_sv.qm</file>
</qresource>
<qresource lang="de">
<file alias="xxx.qm">tr/xxx_de.qm</file>
</qresource>
</RCC>/Hakan
-
Which Qt version do you use? There seems a buf in Qt 5.1 that may affect you (prevents to find the correct locale), see QTBUG-31651; referenced in https://blog.qt.digia.com/blog/2013/07/23/anatomy-of-a-qt-5-for-android-application/#comment-1103021