Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Please combine all the translations for each locale's modules into a single qt_??.qm file #194

Open
@SlySven

Description

@SlySven

https://doc.qt.io/qt-6/localization.html#deploy-translations mentions the following:

In addition to the application's QM files, you need to deploy the QM files for the Qt modules that you use in the application, unless they are installed on the system.

The QM files are split up by module and there is a so-called meta catalog file which includes the QM files of all modules. However, you only need to deploy the QM files for the modules that you use in the application.

You can use the lconvert tool in the deploy step to concatenate the required QM files into one file that matches the meta catalog file. For example, to create a German translation file for an application that uses the Qt Core, Qt GUI, and Qt Quick modules, run:

lconvert -o installation_folder/qt_de.qm qtbase_de.qm qtdeclarative_de.qm

I'm in the process of migrating my project from linuxdeployqt to linuxdeploy with the linuxdeploy-plugin-qt plugin and have just spotted that the latter is including (in my particular case) qtbase_xx.qm and qtmultimedia_xx.qm for each locale whereas the former does produce the combined qt_xx.qm that the above suggests. I would point you to the shared.cpp file in that project but since it is GPL licenced whereas this one is MIT I don't want to lead anyone to precisely copy what is there as it can't be used here. I'm guessing that (inline bool) deployTranslations(appdir::AppDir&, const fs::path&, const std::vector<QtModule>&) is the place to fix this...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions