Skip to content

How to add languages

seriousm4x edited this page Mar 5, 2025 · 14 revisions

Explanation

There are two different language code formats:

  • Language Code specifies the base language. For example: en
  • ISO Country Code is defined as language-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.

Adding a new language

  1. Fork this repo and clone your fork
  2. Create your own branch named add-i18n-LANG. Example
git switch -c add-i18n-en
  1. Go to frontend/translations/ and create a new file called LANG.json. Example: en.json
  2. Do all the translations for the new language. (Take a look at existing translations and copy where needed)
  3. Add your new locale to the project.inlang settings.
  4. 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.
  5. Add the corresponding flag emoji in the account page
  6. Run format and lint:
pnpm run format
pnpm run lint
  1. If no warnings/errors show up, commit, push and create a pull request.

Clone this wiki locally