-
Notifications
You must be signed in to change notification settings - Fork 4
Translating the collection into your language
The icestudio collections are prepared to be translated into any languajes. Both, the blocks and the examples show their texts in the current selected languaje
The text are changed interactively when another languajes is selected, as long as there is a translation available
All the translations are located in the locale
folder. The file translation.js
contains all the English texts to be translated to the target languaje. For every languaje there exist another folder with the languaje localization. For example, the locale for Spanish languaje in Spain es es_ES. Inside that folder is located the .po
file which contains the texts in English and their translations into Spanish
The tools needed for translating are:
-
Icm: Icestudio Collection Manager. This tools is used for generating a new
translation.js
file with the English texts extracted from the blocks and examples of the collection. It also allow us to update the Readme file with the latest blocks, examples and the percentage of translation to the different languajes
-
poedit: Editor for translating the English texts and generating a new
.po
file
You can install Poedit directly from its main page, for Linux, Mac and Windows
It is also available in the main Linux distributions. For example if you are running Ubuntu 20.04, you can install it with the following command:
sudo apt install poedit
You need first to install python 3. Then you install icm
with this command:
pip install icm
If you are running Ubuntu 20.04 its better to install it with this command:
sudo pip3 install -U icm
If you want to translate the collection to another languaje follow these steps:
-
Fork the collection repo in your github account and Clone it in your computer. You have now a local copy of the collection repo
-
Enter into the collection main folder
cd iceK
- Get the latest English text from the blocks and examples in the collection
icm update
It will refresh the translation.js
file with the latest English texts found in the examples and blocks
4.Locate the current .po for you localization. For example, for the Spanish translation the file is locale/es_ES/es_ES.po
- Open the .po file with the poedit and click on the update from code button. It will read the translation.js with the latest texts in English and merge them with the current .po file
- Work on the translation. Once you finish it, click on the save button. The new .po file will be ready
-
From the collection main folder execute again the command
icm update
. It will generate an updated README.md file -
Emit a pull request with you contribution! Thanks! 😀️
-
Your translation will be available to anyone in the next collection release