aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2024-02-10 18:12:57 +0100
committerDaniel Schadt <kingdread@gmx.de>2024-02-10 18:12:57 +0100
commite226f6c95811275c1f34161d285ce038fb72b86b (patch)
tree07538b0400ad89b65450e57d532fbf5b7cfd29b1
parent3b80d41cd5cd5b1d83679ac5700b9f81a2150049 (diff)
downloadfietsboek-e226f6c95811275c1f34161d285ce038fb72b86b.tar.gz
fietsboek-e226f6c95811275c1f34161d285ce038fb72b86b.tar.bz2
fietsboek-e226f6c95811275c1f34161d285ce038fb72b86b.zip
update docs about new lang display name feature
-rw-r--r--doc/developer/language-pack.rst5
-rw-r--r--doc/developer/localize.rst17
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