ProtonMail / WebClients

Monorepo hosting the proton web clients
GNU General Public License v3.0
4.27k stars 545 forks source link

How to generate translation JSON files? #281

Closed xet7 closed 1 year ago

xet7 commented 1 year ago

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):


Hi, Do you have some script that can convert Crowdin translations, from translator downloadable file format, to JSON format that is used in this repo ProtonMail etc? Where is that script? I tried to create bash script for it, but I did not get it working well enough yet.

I'm trying to test fi_FI.json translation, does web UI have enough space for words, does it look correct, or should I change to shorter words, or submit pull request to React UI template code to fix it?

dhoko commented 1 year ago

Hey :wave:

We use ttag-cli to extract strings and build them. Ex we build the json file from the gettext via npx ttag po2json '{file_path}' --format=compact -p.

I'm trying to test fi_FI.json translation

We don't work with the JSON itself but with gettext files sent to crowdin, if you want to fix translation you can join us on crowdin and fix this language there, thx cf https://github.com/ProtonMail/WebClients#help-us-to-translate-the-project

This summary inside the readme needs an update :fearful:

thx :pray: