diff options
Diffstat (limited to 'doc/developer')
-rw-r--r-- | doc/developer/language-pack.rst | 5 | ||||
-rw-r--r-- | doc/developer/localize.rst | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/doc/developer/language-pack.rst b/doc/developer/language-pack.rst index 71cf9e8..ae6042d 100644 --- a/doc/developer/language-pack.rst +++ b/doc/developer/language-pack.rst @@ -86,7 +86,10 @@ translate them: .. code-block:: bash - cp -rv $FB_PATH/locale/en/html + cp -rv $FB_PATH/locale/en/html $PACK_PATH/fb_i18n_nl/locale/nl + +Don't forget to adjust the :file:`locale/.../DISPLAY_NAME` file to give your +language pack the correct human-readable representation. Translating & Compiling ----------------------- diff --git a/doc/developer/localize.rst b/doc/developer/localize.rst index 91a51eb..d33b22d 100644 --- a/doc/developer/localize.rst +++ b/doc/developer/localize.rst @@ -52,6 +52,11 @@ The :file:`justfile` (requires just_) contains a shortcut for this command: Creating a New Language ----------------------- +.. note:: + + Consider creating a :doc:`Language Pack <language-pack>` instead, that way + you can update the translation independently of fietsboek development. + If you want to add a translation for a language that does not yet exist, first generate the ``.po`` file containing the messages using :program:`pybabel`: @@ -62,7 +67,7 @@ generate the ``.po`` file containing the messages using :program:`pybabel`: This will create the directory :file:`fietsboek/locale/{language}`. -Finally, you need to copy the non-gettext messages. This is best done by +Then, you need to copy the non-gettext messages. This is best done by copying over the english original texts: .. code:: bash @@ -70,6 +75,16 @@ copying over the english original texts: # Replace nl with the locale that you just generated cp -r fietsboek/locale/en/html fietsboek/locale/nl/ +Finally, you can adjust the name under which the language is shown by adjusting +the content of the :file:`DISPLAY_NAME` file in the locale's folder: + +.. code:: bash + + echo "Nederlands" > fietsboek/locale/nl/DISPLAY_NAME + +Note that this file should be UTF-8 encoded, and you can use country flag +emojies to add visual representations. + Again, there is a shortcut in the :file:`justfile` that does both steps: .. code:: bash |