Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Deploying translation .qm files
I have a localized application. I have the .qm files and if I copy them to the program directory on desktop, it works fine.
But if compile my application for Android the translation files are not copied to the APK. I think I need to add something to my .pro file so that QtCreator knows that it should include those files. But I could not find how to do it.
You need to add them to
QMAKE_BUNDLE_DATAso they will be copied over. However, with translation file, it's also pretty usual to embed them in your application using Qt's resource system.
Thank you, I looked at the Qt Resource System documentation and found the correct solution.
portegael last edited by
I am not sure how to use the QMAKE_BUNDLE_DATA to my Android APK.
I have tried different things but nothing successful so far. Would you have more tips to give me ?
Thanks in advance.
it's explained here
But the documentation says: This variable is used on OS X and iOS only.
I managed to add the translation files to my Android application using .qrc file. And it works for other platforms too.
My bad, for Android you can use the assets file system. You can use that when you have to embed e.g. multimedia assets.