Skip to content

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 .svelte files: {$t`Save`} in markup and script, <Trans>…<strong>{x}</strong>…</Trans> for markup inside a sentence, $plural(n, { one: '# shooter', other: '# shooters' }).
  • In plain .ts files only message descriptors with msg from @lingui/core/macro (see $lib/labels.ts), translated in components with $t(descriptor).
  • Keep the Plural-Forms headers in the PO files (French n > 1, the others n != 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:

l := i18n.Get(ev.Locale)
title := i18n.Tf(l, "Ranking %s", name)

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.