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

Separate translations for QMimeTypeDatabase

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Core: Locales (i18n)
    • None
    • 21
    • Foundation Sprint 112, Foundation Sprint 113, Foundation Sprint 114, Foundation Sprint 115, Foundation Sprint 116, Foundation Sprint 117, Foundation Sprint 118, Foundation Sprint 119, Foundation Sprint 120, Foundation Sprint 121

    Description

      Currently, translations are embedded into the mimetype database itself. Consider switching it to use the Qt translation system (.ts / .qm files).

      API / Use cases

      Currently, the mimetype database contains various translations that are exposed via QMimeType::comment(). The chosen translation is determined via the default QLocale().

      Qt uses QMimeType::comment() itself in file dialogs (e.g. QXdgDesktopPortalFileDialog, and QFileSystemModel(via QAbstractFileIconProviderPrivate::getFileType).

      Proposal

      Remove the translations from the embedded .xml file, and instead provide them as part of the qtbase translations.

      Advantages

      Reduction of Qt Core binary size.

      The mimetype database to be loaded would be significantly smaller - without translations, the default database size on file system shrinks from 2515 KB to 313 KB. Qt Core binary size is reduced by 5% (from 5.398 KB to 5.105 KB in a release build on Windows).

      Consistent translations

      Using .ts/.pm files would make the handling of translations consistent with the translations of other parts of the user interfaces, for instance for file-dialogs.

      Disadvantages

      Behavior change

      This would be a behavior change.

      Challenges

      The freedesktop.xml database currently contains translations for 57 locales. qtbase currently only features translations for 29 locales.

      Conversion tool

      TODO: extract translations from .xml into .ts file, for instance with Apache xalan or Python's lxml. This could then be run in qttranslations whenever qtbase_xz.ts is updated.

      Attachments

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

        Activity

          People

            magdalenas Magdalena Stojek
            kkohne Kai Köhne
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: