diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-12-10 16:49:18 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-12-10 16:49:18 +0100 |
commit | c86100cd0ca4bf74597be4f4d34eaceae748aba5 (patch) | |
tree | 0450be27fdd4ad6fd81e716508c66e76d384c97c /doc/developer/localize.rst | |
parent | 0130f540ffefac371910a05cf52f30ac3bf06b5b (diff) | |
parent | 07512ee824c5d453cf32b7cb0fea83973f40dd0c (diff) | |
download | fietsboek-c86100cd0ca4bf74597be4f4d34eaceae748aba5.tar.gz fietsboek-c86100cd0ca4bf74597be4f4d34eaceae748aba5.tar.bz2 fietsboek-c86100cd0ca4bf74597be4f4d34eaceae748aba5.zip |
Merge branch 'external-languages'
Diffstat (limited to 'doc/developer/localize.rst')
-rw-r--r-- | doc/developer/localize.rst | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/developer/localize.rst b/doc/developer/localize.rst index c345c3e..91a51eb 100644 --- a/doc/developer/localize.rst +++ b/doc/developer/localize.rst @@ -43,11 +43,11 @@ In order to do so, use the :program:`pybabel` binary: .venv/bin/pybabel extract -F babel.cfg -o fietsboek/locale/fietslog.pot --input-dirs=fietsboek -The :file:`Makefile` contains a shortcut for this command: +The :file:`justfile` (requires just_) contains a shortcut for this command: .. code:: bash - make babel-extract + just extract-messages Creating a New Language ----------------------- @@ -60,12 +60,6 @@ generate the ``.po`` file containing the messages using :program:`pybabel`: # Replace LOCALE with the locale name, for example "nl" or "fr" .venv/bin/pybabel init -d fietsboek/locale -l LOCALE -i fietsboek/locale/fietslog.pot -Again, there is a shortcut in the :file:`Makefile`: - -.. code:: bash - - make babel-init LOCALE=nl - This will create the directory :file:`fietsboek/locale/{language}`. Finally, you need to copy the non-gettext messages. This is best done by @@ -76,6 +70,12 @@ copying over the english original texts: # Replace nl with the locale that you just generated cp -r fietsboek/locale/en/html fietsboek/locale/nl/ +Again, there is a shortcut in the :file:`justfile` that does both steps: + +.. code:: bash + + just init-language nl + Updating a Language ------------------- @@ -94,7 +94,7 @@ Alternatively, you can also use the shortcut again: .. code:: bash - make babel-update LOCALE=nl + just update-language nl Translating ----------- @@ -125,10 +125,12 @@ Or using the shortcut: .. code:: bash - make babel-compile LOCALE=nl + just compile-language nl Further Reading --------------- * The Pyramid documentation: `Internationalization and Localization <https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/i18n.html>`__ + +.. _just: https://github.com/casey/just |