Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-112857

Automatically merge translation files at build time

XMLWordPrintable

    • 6e7a77330 (dev)

      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.

       

        For Gerrit Dashboard: QTBUG-112857
        # Subject Branch Project Status CR V

            jbornema Joerg Bornemann
            kkohne Kai Köhne
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes