canaille-globuzma/canaille/translations/README.rst

43 lines
1.6 KiB
ReStructuredText
Raw Normal View History

Translations are done with `Weblate <https://hosted.weblate.org/projects/canaille/canaille>`__.
2024-03-28 13:22:07 +00:00
The following commands are there as documentation, only the message extraction is needed for contributors.
2023-03-12 09:45:29 +00:00
All the other steps are automatically done with Weblate.
2020-10-23 11:38:36 +00:00
2024-05-08 08:08:46 +00:00
Message extraction
~~~~~~~~~~~~~~~~~~
2024-03-28 13:22:07 +00:00
After you have edited translatable strings, you should extract the messages with:
2024-05-08 08:08:46 +00:00
.. code-block:: bash
pybabel extract --mapping-file pyproject.toml --copyright-holder="Yaal Coop" --output-file canaille/translations/messages.pot canaille
2020-10-23 11:38:36 +00:00
2024-05-08 08:08:46 +00:00
Language addition
~~~~~~~~~~~~~~~~~
2020-10-23 11:38:36 +00:00
2024-03-28 13:22:07 +00:00
You can add a new language manually with the following command, however this should not be needed as Weblate takes car of this:
2024-05-08 08:08:46 +00:00
.. code-block:: bash
pybabel init --input-file canaille/translations/messages.pot --output-dir canaille/translations --locale <LANG>
2020-10-23 11:38:36 +00:00
2024-05-08 08:08:46 +00:00
Catalog update
~~~~~~~~~~~~~~
2020-10-23 11:38:36 +00:00
2024-03-28 13:22:07 +00:00
You can update the catalogs with the following command, however this should not be needed as Weblate automatically update language catalogs when it detects new strings or when someone translate some existing strings.
Weblate pushes happen every 24h.
2024-05-08 08:08:46 +00:00
.. code-block:: bash
2020-10-23 11:38:36 +00:00
2024-05-08 08:08:46 +00:00
pybabel update --input-file canaille/translations/messages.pot --output-dir canaille/translations --ignore-obsolete --no-fuzzy-matching --update-header-comment
Catalog compilation
~~~~~~~~~~~~~~~~~~~
2020-10-23 11:38:36 +00:00
2024-03-28 13:22:07 +00:00
You can compile the catalogs with the following command, however this should not be needed as catalogs are automatically compiled before running the unit tests, before launching the demo and before compiling the Canaille python package:
2024-05-08 08:08:46 +00:00
.. code-block:: bash
pybabel compile --directory canaille/translations --statistics