Skip to content

Commit

Permalink
docs: update translation guide
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Aug 30, 2024
1 parent a6498ac commit 3841004
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ babel-init:
pybabel init -D sphinx -i src/shibuya/locale/sphinx.pot -d src/shibuya/locale -l ${lang}

babel-update:
pybabel update -D sphinx -i src/shibuya/locale/sphinx.pot -d src/shibuya/locale
pybabel update -D sphinx -i src/shibuya/locale/sphinx.pot -d src/shibuya/locale -l ${lang}

babel-compile:
pybabel compile -D sphinx -d src/shibuya/locale
3 changes: 3 additions & 0 deletions docs/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Everyone wants a good documentation. There may be mistakes
or things missing in the documentation, you're welcome to
help us improving the documentation.

.. _development:

Development
-----------

Expand Down Expand Up @@ -101,4 +103,5 @@ Now, your environment is ready for development. Open your browser, and visit
.. toctree::
:hidden:

translations
roadmap
46 changes: 46 additions & 0 deletions docs/contributing/translations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
:description: Help us translating this documentation into other languages.

Translations
============

To begin translating this documentation into other languages, please
start by referring to the :ref:`development` guide, which will help
you set up a suitable development environment.

Adding a new language
---------------------

First, we need to generate the ``.po`` file in your preferred language:

.. code-block:: shell
make babel-init lang=it
In this example, we're using the language code ``it`` to represent Italian.

Updating languages
------------------

If the language exists, you can update the ``.po`` files using the
following command:

.. code-block:: shell
make babel-update lang=it
Writing the translations
------------------------

Following the previous command, the ``.po`` files will be generated within
the ``src/shibuya/locale/it/LC_MESSAGES`` directory. You can now edit these
files to add the Italian translations accordingly.

Compiling the translations
--------------------------

Once, the translations are completed. You need to compile the translations
before validating it.

.. code-block:: shell
make babel-compile

0 comments on commit 3841004

Please sign in to comment.