Embedding Qt's own language files
-
For my own application language files, I embed them in the application using a translations.qrc file:
<!DOCTYPE RCC><RCC version="1.0"> <qresource prefix="i18n"> <file>DSS.ca.qm</file> <file>DSS.cs.qm</file> <file>DSS.de.qm</file> <file>DSS.en.qm</file> <file>DSS.es.qm</file> <file>DSS.fr.qm</file> <file>DSS.it.qm</file> <file>DSS.nl.qm</file> <file>DSS.pt_BR.qm</file> <file>DSS.ro.qm</file> <file>DSS.ru.qm</file> <file>DSS.tr.qm</file> <file>DSS.zh_TW.qm</file> </qresource> </RCC>
I realise that windeploytqt will copy the Qt language files from $QtInstallDir\msvc2019_64\translations to a subdirectory of my output directory called translations. Instead of doing that however I'd prefer to include them in my .exe file to reduce the number of files I need to ship when I release the code.
What's the preferred way to do that? Do I hack the qrc file above to add them directly from $QtInstallDir\msvc2019_64\translations ? Or do you suggest a different approach?
-
@Perdrix said in Embedding Qt's own language files:
What's the preferred way to do that? Do I hack the qrc file above to add them directly from $QtInstallDir\msvc2019_64\translations ? Or do you suggest a different approach?
Disclaimer: I've never tried to override windeployqt and manually manage the Qt translations, so I don't have an approach to suggest. But here are some notes that might be of interest to you:
Notice that windeployqt runs
lconvert.exe
to merge multiple files into one. The different source files come from different modules. So if you want to manage those directly, make sure you grab all the files from the various modules. You might also want to pre-merge them and add them to your own project.Notice also that some files are very tiny (~150+ bytes). These are "blank" files that you want to avoid.