Qt Localization - Qt Wiki (original) (raw)

Translating Qt Into Other Languages

Qt aims at being fully internationalized by use of its own i18n framework.

Localizations are provided on a best-effort basis by the community; the Qt Company employees involved in these activities are volunteering to do so. Here is how you can help:

Translation efforts are coordinated over the localization@qt-project.org mailing list. If you are starting an entirely new translation, please cross-post to interest@qt-project.org or qt-creator@qt-project.org respectively, to possibly find other interested people.

If you really do not wish to communicate in the open, you may contact oswald.buddenhagen@gmx.de. Real-time communication is possible in the #qt-labs and #qt-creator channels on irc.freenode.net. Ask ossi. (For a full list of IRC channels of interest to Qt developers, see OnlineCommunities.)

Please talk with us before you start - otherwise you may end up duplicating work, translating a dead or highly unstable branch, etc. We've seen it before.

You should probably check whether KDE already has a translation of Qt (v4.x) to your language and whether they would be willing (and legally able) to contribute it to Qt upstream. Even if not, somebody from the community may be willing to help you.

Preferentially, you should target the oldest still maintained LTS branch of Qt, and subsequently update the newer LTS branches and then the current stable or stabilizing branch.
Note that it makes little sense to start translating until a particular release cycle enters the string freeze, somewhere between the last beta and the first release candidate. Approximate release dates will be announced on the mailing list, usually leaving around two weeks for completing the translation. When you are starting somewhere in the middle of a release cycle, the only sensible option is translating the latest stable release. Never translate dev/master.

The actual act of submitting a translation is the same as for source code (see Qt Contribution Guidelines).
In case you really cannot find your way through git/Gerrit and cannot find someone to help you, you may simply attach the ts files to an appropriate JIRA task (the respective components of the various products are named "Translations (l10n)"). Note that this process is suboptimal and may result in delays.
Do not create Github pull requests or send emails with attachments - we cannot process these for legal reasons.

The Qt Project has a presence on Transifex, but this does not affect the submission process itself.Update: This presence is dysfunctional. Don't use it.

Instructions for Qt

Note that unlike the rest of Qt, the translations still use a forward-merging branch model, so you should target the oldest branch you find still relevant first.

Updating existing translations for a new minor release

Qt 6
Qt 5

Starting a not-yet existing translation

The translation files live in a dedicated repository, qttranslations.

First, you need translation templates to work with. Qt uses its own TS (translation source) XML file format for that.

There are several ways to get them:

The next step is doing the actual translation. :-)

The "native" tool for translating TS files is Qt Linguist. It is pretty self-explanatory and comes with documentation.
If you prefer to use another tool (most probably because of better support for translation memory), you might need to convert the TS files to and from some other format:

$ lconvert .ts -o .po $ .po $ lconvert -locations none .po -o .ts

XLIFF might also work for your tool.

Note: Always use the latest stable Linguist tools available. Also, 3rd party tools like ts2po were known to cause trouble.

When you translate legal text like copyright notices or licenses, include a verbatim copy of the original below, and note that it is the authoritative version in case of doubt.

If you find that particular messages need additional context to be translatable, you should report that as bugs and ideally add //: comments to the code yourself if you can figure it out.

Don't hesitate to report mistakes in the original strings, though we can't merge these fixes during string freeze, obviously.

To test the translations live, just run make in the translations subdirectory and run whatever application that uses the strings in question. You will need to copy the QM file(s) to the installation directory of the Qt you are actually using if the Qt sources you are translating are not your current Qt installation.

It is essential that you mark finished translations as such - otherwise the script used for assessing the completeness will not see them and will exclude them from compilation in the release.

Next, if you are re-using a Qt 4 translation for Qt 5, run

lconvert -no-obsolete -i -o

to dispose of the old strings. Next, you need to commit any PRI/PRO files you modified and the TS file(s) you translated. If you added new files, first run

(the -N is important!). Then run

to check in the files (you should have no other modified files due to the use of language-specific ts targets). The commit-ts target will also strip out line number information from the TS files to keep the changes smaller.

Finally, you need to post a change on Gerrit for review.

Instructions for the Installer Framework

The instructions are almost identical to the ones for Qt, except that the translations and various ts- targets live in src/sdk/translations inside the Installer Framework repository itself. Note that the translations are compiled into the framework itself (run make in src/sdk), so it's somewhat hard to test them "in-vivo".

Instructions for Qt Creator

The instructions regarding coordingation via the mailing list and the submission process are similar to the ones for Qt. The translation (.ts) files are located at share/qtcreator/translations.

Regarding the creation and update of translation files and other guidelines, please see the README.md in the source tree next to the translation files.

Qt Creator will not use the translation unless it finds one for the Qt library as well. Qt Designer, Qt Assistant and the Qt Help library should be translated as well, though failure to do so will go unnoticed at first.

See also the Qt Creator Translation Page.

Translating Qt Documentation Into Other Languages

The infrastructure for that is somewhat lacking. Still, there is for example the simplified Chinese doc translation.