Translations¶
Source strings are English and serve as the keys of gettext PO catalogs.
Frontend¶
Lingui 6 with lingui-for-svelte; catalogs in web/src/locales/{en,de,fr,it}.po.
- In
.sveltefiles:{$t`Save`}in markup and script,<Trans>…<strong>{x}</strong>…</Trans>for markup inside a sentence,$plural(n, { one: '# shooter', other: '# shooters' }). - In plain
.tsfiles only message descriptors withmsgfrom@lingui/core/macro(see$lib/labels.ts), translated in components with$t(descriptor). - Keep the
Plural-Formsheaders in the PO files (Frenchn > 1, the othersn != 1). - The user's language is
users.locale(PUT /api/me/locale); kiosk pages use the event's language unless the link says otherwise.
Backend¶
PDFs, reports, CSV exports and print job titles use the event's language through internal/i18n:
Only these package-level calls are extracted (xgettext -L Go --keyword=T:2 --keyword=Tf:2, gettext 0.25 or newer). Catalogs are internal/i18n/locales/{de,fr,it}.po plus messages.pot.
Workflow¶
make i18n extracts the strings of both parts and merges them into the catalogs; it leaves the files untouched when nothing changed. On every push to master the CI job po does the same and commits the result, so forgotten extractions do not get lost. New strings show in English until they are translated. npm run build extracts before compiling, because production builds strip the source text from the macros.