feat: Multi-language support

This commit is contained in:
Waled Khatiz
2024-08-30 14:25:57 +10:00
parent 673f10b007
commit 75a4eb6490
3 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# Contributing Translations
To contribute to the translation of your language you must modify the json in `/messages` that is named corresponding to the ISO Language Code of your given language.
If you do not see a JSON for your language then add the language.
## Adding a language
1. To add a language you must add the language to the `const SUPPORTED_LANGUAGES = ['en', 'de'];` variable in the `./src/i18n.ts` file.
2. You must create a new `.json` file in the `./messages` directory
3. Copy the contents of the `en.json` file, make your way down the key-value pairs and change **only the values** to the translated equivalent.

7
messages/de.json Normal file
View File

@@ -0,0 +1,7 @@
{
"navigation": {
"getting-started": "Erste Schritte",
"donate": "Spenden",
"useful-links": "Nützliche Links"
}
}

7
messages/en.json Normal file
View File

@@ -0,0 +1,7 @@
{
"navigation": {
"getting-started": "Getting Started",
"donate": "Donate",
"useful-links": "Useful Links"
}
}