mirror of
https://github.com/maputnik/editor.git
synced 2025-12-06 06:10:00 +00:00
add german translation, update docs (#931)
- add german translation (following the changes in https://github.com/maplibre/maputnik/pull/929) - using an alphabecial order for the languages - update the documentation with a step-by-step guide - add myself as a helping person for german - move the helping-users list to the implementation of new features - update CHANGELOG.md - add a link to the l18n README in the root README 
This commit is contained in:
@@ -2,22 +2,57 @@
|
||||
|
||||
The process of internationlization is pretty straight forward for Maputnik.
|
||||
|
||||
In order to add a new translation you'll need to create a new folder and a json file with the relevant language code and make sure all the keys are translated.
|
||||
The following users can help you with the relevant languages:
|
||||
## Add a new language
|
||||
|
||||
- English - @HarelM
|
||||
- Japanese - @keichan34
|
||||
- Simplified Chinese - @jieme
|
||||
- Hebrew - @HarelM
|
||||
- French - @lhapaipai
|
||||
#### 1. Edit configuration
|
||||
|
||||
In order to add a new translation you'll need to add it to the configuration files. Please put it in alphabetical order.
|
||||
|
||||
- Open [/i18next-parser.config.ts](/i18next-parser.config.ts) and add the ISO Code of your language to the `locales` array.
|
||||
- Now, open [/src/i18n.ts](/src/i18n.ts) and add the ISO Code and localized name to the supported languages.
|
||||
|
||||
#### 2. Add the localized strings
|
||||
|
||||
Refresh the localization to generate a new directory under `/src/locales/` for your new language.
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run i18n:refresh
|
||||
```
|
||||
|
||||
Replace every `__STRING_NOT_TRANSLATED__` value in the newly generated `translation.json` file with the according translation.
|
||||
Make sure all the keys are translated.
|
||||
|
||||
#### 3. Test your new locale
|
||||
|
||||
Finally, test your language locally by starting a local instance of Maputnik.
|
||||
|
||||
```bash
|
||||
npm run start
|
||||
```
|
||||
|
||||
Consider adding your name as a helping person for the translation of new features.
|
||||
|
||||
## Add localization for a new feature
|
||||
|
||||
If you happen to add a feature which needs some text to be translated, update the translation files.
|
||||
After running, check your working copy for files and add/correct as needed.
|
||||
|
||||
```
|
||||
```bash
|
||||
npm run i18n:refresh
|
||||
```
|
||||
|
||||
The following users can help you with the relevant languages:
|
||||
|
||||
| ISO Code | Language | User |
|
||||
|----------|--------------------|--------------------------------------------|
|
||||
| de | German | [@josxha](https://github.com/josxha) |
|
||||
| en | English | [@HarelM](https://github.com/HarelM) |
|
||||
| fr | French | [@lhapaipai](https://github.com/lhapaipai) |
|
||||
| hr | Hebrew | [@HarelM](https://github.com/HarelM) |
|
||||
| ja | Japanese | [@keichan34](https://github.com/keichan34) |
|
||||
| zh | Simplified Chinese | [@jieme](https://github.com/jieme) |
|
||||
|
||||
You can test the UI in different languages using the dropdown in the top menu
|
||||
Note that Maputnik automatically localize based on browser language settings and stores this language in local storage.
|
||||
You can use incognito mode to check a first time usage.
|
||||
|
||||
Reference in New Issue
Block a user