2023-03-12 09:45:29 +00:00
|
|
|
Translations are done with [weblate](https://hosted.weblate.org/projects/canaille/canaille/).
|
|
|
|
Those commands are there as documentation, only the message extraction is needed for contributors.
|
|
|
|
All the other steps are automatically done with Weblate.
|
|
|
|
|
2020-10-23 11:38:36 +00:00
|
|
|
Extract the messages with:
|
|
|
|
|
|
|
|
```
|
2023-07-28 17:17:26 +00:00
|
|
|
pybabel extract --mapping-file canaille/translations/babel.cfg --copyright-holder="Yaal Coop" --output-file canaille/translations/messages.pot canaille
|
2020-10-23 11:38:36 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Add a new language with:
|
|
|
|
|
|
|
|
```
|
2020-12-31 11:41:38 +00:00
|
|
|
pybabel init --input-file canaille/translations/messages.pot --output-dir canaille/translations --locale <LANG>
|
2020-10-23 11:38:36 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Update the catalogs with:
|
|
|
|
|
|
|
|
```
|
2023-07-24 17:36:11 +00:00
|
|
|
pybabel update --input-file canaille/translations/messages.pot --output-dir canaille/translations --ignore-obsolete --no-fuzzy-matching --update-header-comment
|
2020-10-23 11:38:36 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Compile the catalogs with:
|
|
|
|
|
|
|
|
```
|
2023-07-24 17:36:11 +00:00
|
|
|
pybabel compile --directory canaille/translations --statistics
|
2020-10-23 11:38:36 +00:00
|
|
|
```
|