Hylki's interface text is translated with gettext. Everything a translator needs is in this directory; no Rust knowledge is required, and no source file has to be touched.
-
Take the template,
hylki.pot. It lists every string the app shows, with an empty slot for the translation. -
Create
<lang>.pofrom it, where<lang>is the language code (frfor French,pt_BRfor Brazilian Portuguese):msginit --locale=fr --input=hylki.pot --output=fr.poor open the template in Poedit or Gtranslator and save it as
fr.po. To update an existing translation after the template changed, open the.pofile and use the editor's "update from template" (ormsgmerge --update fr.po hylki.pot); new strings show up untranslated and changed ones as "fuzzy". -
Translate. Keep the
{placeholders}exactly as they are (they are filled in at runtime), but move them around freely to suit the language. Strings with two forms are plurals: give the singular and the plural your language uses. -
Add the language code to
LINGUAS(one per line) if it is new. -
Check it compiles:
msgfmt --check fr.po -o /dev/null. -
Send the
.pofile as a pull request, or attach it to an issue.
From a source checkout:
tools/build-locale.sh # compiles po/*.po for a source-tree run
LANG=fr_FR.UTF-8 ./target/debug/hylki
The app follows the desktop's language. Installs pick up translations
through their normal build: the Flatpak, the RPM and install.sh all
compile po/*.po into their share/locale and merge the translated
launcher and metainfo fields.
tools/update-pot.sh regenerates hylki.pot from the source (through
xtr, the Rust-aware xgettext: cargo install xtr) and refreshes every
.po against it. Run it whenever strings change and before a release, so
translators see the current set. In the code, user-facing strings go
through the helpers in src/i18n.rs: i18n("..."), ni18n for plurals,
i18n_f / ni18n_f for named placeholders, and i18n_noop for tables
of literals translated where they are shown.