Details
-
User Story
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
-
6e7a77330 (dev)
Description
Support automatic merging of .qm files at build time.
Often translations of an application is split up in multiple .ts files . For instance the Qt libraries themselves do support translations for their user visible strings in a modular fashion.
The traditional way to load these .qm files is by loading and registering multiple QTranslator objects, at runtime. Anyhow, this has some challenges:
- You typically do want to load a consistent set of translations. Custom code is needed to handle situations where , for some language, only some .qm files exist.
- Conflicting translations between .ts files are not detected.
macOS expects a list of supported languages as part of the app bundle metadata.(This is solved as of Qt 6.7. One can specify I18N_TRANSLATED_LANGUAGES in qt_standard_project_setup, and that information is written to the bundle meta data.)
It would be therefore better to semi-automatically merge translations at build time, for instance with the lconvert tool. Such a synthesized .qm file could then also be named so that the logic in QQmlApplication will automatically load it.
Attachments
Issue Links
- is required for
-
QTBUG-120597 Renew QTranslator API to handle more complex use cases
- Open
- relates to
-
QTBUG-110444 Investigate translations + deployment related feedback after Qt 6.5 CMake api review
- Closed
-
QTBUG-121980 Support embedding Qt's translation files into executable
- Closed