Translating Pelton¶
New here?
Worth reading the Contributing guidelines first, they cover ground rules and the PR workflow this guide assumes.
Where translations live¶
UI strings live in frontend/src/lib/locales/, one TypeScript file per
language: en.ts, de.ts, fr.ts, nl.ts, es.ts, pl.ts, tr.ts. Each file
exports a flat Record<string, string> keyed by a dotted, feature-prefixed
key, for example:
const en: Record<string, string> = {
'menu.compose': 'Compose',
'shortcut.search': 'Search',
'settings.about': 'About',
// ...
};
English (en.ts) is the source of truth. Every other file mirrors its
keys with a translation for that language.
Adding or fixing a translation¶
- Open the locale file for the language you're editing.
- Find the key (search for its English value in
en.tsif you're not sure which key it is). - Change the string on the right-hand side of the
key: 'value'pair. Don't change the key itself, only the value.
There's no build step to run and no key-enforcement check, a locale file
can be missing a key without failing anything, it just falls back silently.
So if you're adding a new key (as part of a feature, not a
translation fix), add it to all seven locale files, not just en.ts. A
reasonable best-effort translation is fine for languages you don't speak
natively, flag it in your pull request if you're unsure.
Adding a new language¶
There's no scaffolding command for this yet:
- Copy
en.tsto a new file named after the language's ISO 639-1 code, e.g.it.tsfor Italian. - Translate every value, keeping every key unchanged. Watch for strings
with an interpolated
{variable}: some languages need the sentence reordered so a case suffix or particle doesn't glue onto the placeholder (Turkish'str.tsrephrases "Move to {folder}" as "{folder} klasörüne taşı" for this reason). - Register the language everywhere its code is checked, not just in
i18n.ts:frontend/src/lib/i18n.ts: add it to theLocaletype, thelocalesarray,localeNames(the language's own spelling of its name, not a translation), and theloadersmap (import('./locales/xx')).frontend/src/lib/flags.ts: add adefaultCountryentry so the phone/region picker has a sensible default for it.internal/desktop/menu_i18n.go: add a native-menu string block (used for the OS menu bar, which isn't rendered by the frontend).internal/desktop/notify.go: add new-mail notification strings.internal/desktop/bind_locales.go: add it tobuiltinLocales, so it's accepted as a base for a user-defined custom locale.
- Open a pull request, a native or fluent speaker reviewing it is welcome but not required to get it merged. If the first pass was drafted with AI assistance, say so in the PR and have it reviewed in-app by a native or fluent speaker before merging.
Need help?¶
See Support.