This document explains how translation targets in po/ are generated, what each build step produces, and the recommended command order for common tasks. ✅
po/holds the project's translation build file and the subdirectories that hold the actual generated translated material which is installed by defaultpo/application/contains the application translatable strings, catalog and linguas. They are not installed by default, but later combined with other translations intopo.po/countries/contains country and language names, catalog and linguas. They are not installed by default, but later combined with other translations intopo.po/extra/contains metadata catalog and linguas. They are installed by default.- The translated
.pofiles inapplication,countriesandextraare provided by Weblate via git pull requests. - Targets in the Meson build: generate a
.pottemplate (optional), compile.pofiles to binary.mofiles, and install.mofiles into the configuredlocaledir. - In the Flatpak the different languages go into different
.Locales which are installed alongside the app dependent on the Locales in your environment.
-
Regenerate the POT template [only when translatable strings have been updated in the app]:
# Enable POT generation via Meson option, then run the pot target meson setup builddir -Dtranslation=update meson compile -C builddir application-pot meson compile -C builddir countries-pot meson compile -C builddir extra-pot -
Generate translations:
- Git - Check in the
.potfiles into the tunerdevelopmentbranch - Update (Weblate)[https://hosted.weblate.org/projects/tuner/] from the Operation-Repository Maintanence menu
- Translate the strings
- Push the translations back to the tuner development branch
- Git - Check in the
-
Incorporate the updated translation
- Update your work folder from the
develomentbranch rm -r builddir- clear the buildmeson setup builddirwill fire a hook that concatenates the.pofiles inpo/applicationandpo/countriesintopo
- Update your work folder from the
-
Compile translations (.po → .mo):
meson compile -C builddirfires of the meson gettext target inpo, compiling the.po's into.mo's and installing them
- The more volatile translatable strings in the application were split into two components:
countriesconstains the larger set of more static translatable stringsapplicationcontains the smaller set of more volatile strings in the UI
- Separate components simplifies the management of translations on Weblate
- Script
scripts\update-po.shconcatenates.pofiles usinggettext msgcatduring setup - A single
.poper LINGUA means that only a single domain is needed in the code
- Missing tools: install the
gettextpackage for your OS. - No output for a language: ensure
po/LINGUASlists the language andpo/<lang>.poexists. - Check Meson's log:
builddir/meson-logs/meson-log.txtfor configure-time issues. - To get more verbose Meson output: use
meson setup --log-level=debugor consultmeson --help.