aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2024-04-04 21:31:57 +0200
committerDaniel Schadt <kingdread@gmx.de>2024-04-04 21:31:57 +0200
commit6ee21f6c078891e4453415cbebd6b7d591185c5f (patch)
treef57490cda863521a352570cb5081435470a4564a /doc
parentf3902c84e07514f252f02a38a2795946f70ba896 (diff)
parent3968fad3a060c40a84eb07a0cf93e22e1161da61 (diff)
downloadfietsboek-6ee21f6c078891e4453415cbebd6b7d591185c5f.tar.gz
fietsboek-6ee21f6c078891e4453415cbebd6b7d591185c5f.tar.bz2
fietsboek-6ee21f6c078891e4453415cbebd6b7d591185c5f.zip
Merge branch 'language-chooser'
Diffstat (limited to 'doc')
-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