On android, you first of all got to figure out, which language is confugured, and the you load the translation file:
// translation
// returns "lang_LOCAL", depending on th device config
QString locale = QLocale::system().name();
// if its not the default language... --> english
if (!locale.startsWith("en_"))
{
qDebug()<<"LOCALE: " << locale;
QString filename = "languages/lang_" + locale; //e.g.: de_DE";
static QTranslator translator;
if (translator.load(filename, ":/") ){
app.installTranslator(&translator);
qDebug() << "Translation file loaded" << filename;
} else {
qWarning() << "Translation file not loaded:" << filename;
qWarning() << "Language " << locale << " not supported yet";
}
}
Just look at the ling. It is all written down there.