[Translations] documentation on embedding translations in the executable.
-
Good morning
Years ago I have looked up the procedure for embedding translations into the executable file. It worked for me, but I remember to have had severe problems to understand the diverse texts that I had found.
Is there something more recent or a documentation which is considered up-to-date with the current Qt releases? Ad hoc, I see links that mention Qt 4.4.3 but chances are, not much has changed anyway since that version.
Otherwise ... I have once written my own howto and just stumbled on it again. Updates might be necessary, but my language was intended to be human understandable. Depending on your reactions, I could publish that once again.
-
Simply add the generated QM files to your qrc resource file should work.
-
Embedding
Into
The
Executable. -
Embedding
Into
The
Executable.@Simplicius-Simplicissimus said in [Translations] documentation on embedding translations in the executable.:
Embedding
Into
The
Executable.???
That's what @Christian-Ehrlicher wrote above.
No need to mock him...
We all can read what you postedRead about the Qt Resource System, if you don't understand.
@Simplicius-Simplicissimus said in [Translations] documentation on embedding translations in the executable.:
Is there something more recent or a documentation which is considered up-to-date with the current Qt releases?
So hard to find the current/latest Qt 6.9 documentation?!
-
The QTLinguist Documentation included in https://doc.qt.io/qt-6/reference-overview.html does not explain how to embed translations in the executable file.
I talk about what you do in the project-file withCONFIG += lrelease embed_translationsI do not need to ship the translation files with the program.
But never mind. Ignore this thread. Ω
-
The QTLinguist Documentation included in https://doc.qt.io/qt-6/reference-overview.html does not explain how to embed translations in the executable file.
I talk about what you do in the project-file withCONFIG += lrelease embed_translationsI do not need to ship the translation files with the program.
But never mind. Ignore this thread. Ω
@Simplicius-Simplicissimus said in [Translations] documentation on embedding translations in the executable.:
The QTLinguist Documentation included in https://doc.qt.io/qt-6/reference-overview.html does not explain how to embed translations in the executable file.
But the other source I linked does...
Literally the first section there:
The Qt Resource System
The Qt resource system is a platform-independent mechanism for shipping resource files in an application. Use it if your application always needs a certain set of files (like icons, translation files, images), and you don't want to use system-specific means to package and locate these resources.
Most commonly, the resource files are embedded into your application executable, or in libraries and plugins that are loaded by the application executable. Alternatively, the resource files can also be stored in an external resource file.
The resource system is based on tight cooperation between Qt's rcc resource compiler, the build system, and the Qt runtime API.This is what @Christian-Ehrlicher told you... and what I was referring to here:
@Pl45m4 said in [Translations] documentation on embedding translations in the executable.:
Read about the Qt Resource System, if you don't understand.
@Simplicius-Simplicissimus said in [Translations] documentation on embedding translations in the executable.:
I do not need to ship the translation files with the program.
Using the resource system you "ship" them as bytecode embedded in your binary.
You don't want to provide 17 files for 17 different languages, right?
What else do you need?!