From 75a4eb64908bd38e1ef96889e590b57f9f35b421 Mon Sep 17 00:00:00 2001 From: Waled Khatiz Date: Fri, 30 Aug 2024 14:25:57 +1000 Subject: [PATCH] feat: Multi-language support --- messages/README-LANGUAGES.md | 18 ++++++++++++++++++ messages/de.json | 7 +++++++ messages/en.json | 7 +++++++ 3 files changed, 32 insertions(+) create mode 100644 messages/README-LANGUAGES.md create mode 100644 messages/de.json create mode 100644 messages/en.json diff --git a/messages/README-LANGUAGES.md b/messages/README-LANGUAGES.md new file mode 100644 index 0000000..ec15c0b --- /dev/null +++ b/messages/README-LANGUAGES.md @@ -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. + + + + + + + diff --git a/messages/de.json b/messages/de.json new file mode 100644 index 0000000..a862be3 --- /dev/null +++ b/messages/de.json @@ -0,0 +1,7 @@ +{ + "navigation": { + "getting-started": "Erste Schritte", + "donate": "Spenden", + "useful-links": "Nützliche Links" + } +} \ No newline at end of file diff --git a/messages/en.json b/messages/en.json new file mode 100644 index 0000000..e0a7a18 --- /dev/null +++ b/messages/en.json @@ -0,0 +1,7 @@ +{ + "navigation": { + "getting-started": "Getting Started", + "donate": "Donate", + "useful-links": "Useful Links" + } +} \ No newline at end of file