-
Notifications
You must be signed in to change notification settings - Fork 953
Translating app.electricitymaps.com
We use a combination of ISO 639-1 language codes and ISO 3166-1 alpha-2 country codes for our locale codes. The language code comes first, optionally followed by a country code if there are multiple locales for a language, separated by a hyphen (-). For example, Brazilian Portuguese is denoted by pt-br
.
Create a file named YOUR_LOCALE.json in this directory with this content: "{}" (without the Double Quotation Marks). You will also need to update the files /web/src/translation/locales.ts and /web/index.html.
Then start using the tool as described below.
There are two ways of updating translations. If you are making bigger changes, then we recommend using the translation-helper.js tool, but if you are only making small changes, then using the GitHub editor might be easier.
This requires that you have cloned the repository and knows how to use git. See Getting started for more information.
We wrote a little tool for this task:
node translation-helper.js
You will be asked to select a language to translate.
Running the tool looks like this:
Languages you can translate: ar, da, de, es, fr, hr, it, ja, nl, pl, pt-br, ru, sv, zh-cn, zh-hk, zh-tw
Which language do you want to translate: de
country-panel.electricity [Electricity]: Elektrizität
zoneShortName.IQ-KUR.countryName [Iraq]: Irak
...
- Find the translation file here and open it.
- Press the edit icon
- Make changes to the translation
- Open a pull request with your changes
Do you have a question or an idea for improvements? Open a new discussion here