-
-
Notifications
You must be signed in to change notification settings - Fork 219
How to add languages
seriousm4x edited this page Mar 5, 2025
·
14 revisions
There are two different language code formats:
-
Language Codespecifies the base language. For example:en -
ISO Country Codeis defined aslanguage-COUNTRY. For example:en-US
datahub.io has a table for all languages.
All language-COUNTRY formats should inherit from the base language. See de and de-DE for example.
- Fork this repo and clone your fork
- Create your own branch named
add-i18n-LANG. Example
git switch -c add-i18n-en- Go to frontend/translations/ and create a new file called
LANG.json. Example:en.json - Do all the translations for the new language. (Take a look at existing translations and copy where needed)
- Add your new locale to the project.inlang settings.
- Open frontend/src/lib/stores/locale.ts, import your new locale from date-fns and add it to the switch statement. Preferably in alphabetical order.
- Add the corresponding flag emoji in the account page
- Run format and lint:
pnpm run format
pnpm run lint- If no warnings/errors show up, commit, push and create a pull request.