Translate Interface
GpgFrontend speaks many languages, and the translations come from the community.
You do not need to know anything about cryptography or the code to help. If you know English and one other language well, you can translate.
What You Need to Know
Section titled “What You Need to Know”GpgFrontend uses Qt’s translation system (since v2.1.2). Translations are edited with Qt Linguist, a graphical tool. The basics:
.tsfiles store the English source strings and their translations.- Qt Linguist opens these files and lets you translate string by string.
- You do not have to finish everything at once; partial work is fine.
- Keep placeholders such as
%1,%2,%n, and HTML-like tags as they are.
Find and Edit the Translation Files
Section titled “Find and Edit the Translation Files”- Download or clone the source code from GitHub. Clone
with
git clone --recursive, so you also get the modules. - Find the
.tsfile for your language:- The application’s files are in
resource/lfs/locale/ts, namedGpgFrontend.<locale>.ts(for exampleGpgFrontend.de_DE.ts). - Each integrated module keeps its own files under
modules/src/<module>/ts/, for examplemodules/src/m_email/ts/ModuleEMail.de_DE.ts.
- The application’s files are in
- Open the file in Qt Linguist, translate, and save. Updating an existing language this way is the most common contribution.
Many features now come from modules: email, instant messaging, key servers,
update checking and more. If you cannot find a string in
GpgFrontend.<locale>.ts, look in the module’s own file. The application and
every module always share the same set of languages.
How the .ts Files Are Generated
Section titled “How the .ts Files Are Generated”The .ts files are not created by hand. The set of supported languages is
defined in one place, GPGFRONTEND_SUPPORTED_LOCALES in
cmake/Translations.cmake,
and both the application and the modules derive their .ts file set from it.
A helper script,
scripts/update_translations.sh,
keeps them in sync. It creates any missing .ts files and pulls new or
changed interface strings into every language file, marking them as
type="unfinished". It covers the application and all modules at once, works
offline, and does not translate anything itself.
To add a brand-new language, add its locale code to
GPGFRONTEND_SUPPORTED_LOCALES and run scripts/update_translations.sh,
which generates the matching .ts files everywhere. See this
locale code list for reference. If you would rather not touch
the build files, ask the maintainer to register the new locale for you, then
translate the generated .ts file.
Translation Lifecycle
Section titled “Translation Lifecycle”Once a language is added, it stays supported in later releases unless it is removed on purpose.
But the interface keeps changing. New features and renamed options bring new strings that are not translated yet. Before a release, the maintainer may fill those gaps with AI translation tools, in languages the maintainer cannot check personally, so every language stays reasonably complete.
Those AI translations are only a temporary fix. They can be clumsy, too literal, or not in line with the usual terms. A human translation is always better, especially for security terms, OpenPGP concepts, and interface wording.
So if you see an awkward or wrong translation in your language, that is your
invitation: edit the .ts file and send in the improved version.
Submitting Your Work
Section titled “Submitting Your Work”There are two ways to send in your work:
- Open a pull request with the changed
.tsfile or files. - Send the updated
.tsfile by email to eric@bktus.com.
When opening a pull request, keep the diff focused on your actual translation changes:
- Edit the text inside the
<translation>elements (and remove thetype="unfinished"marker once a string is translated). Do not modify source string entries or<location>line numbers by hand. - If you ran
scripts/update_translations.shlocally, only commit the.tsfiles for the languages you actually worked on. The script touches every language and module. Leave those other changes out, because they make the pull request harder to review. - Adding a new language touches
cmake/Translations.cmakeas well; mention this in the pull request description so the build change is easy to spot.
Both new languages and corrections to existing translations are welcome.