Contribute translations
=======================

Since `Flower 1.5
<https://flower.ai/docs/framework/ref-changelog.html#v1-5-0-2023-08-31>`_ we have
introduced translations to our doc pages, but, as you might have noticed, the
translations are often imperfect. If you speak languages other than English, you might
be able to help us in our effort to make Federated Learning accessible to as many people
as possible by contributing to those translations! This might also be a great
opportunity for those wanting to become open source contributors with little
prerequisites.

Our translation project is publicly available over on `Weblate
<https://hosted.weblate.org/projects/flower-docs/framework/>`_, this where most of the
work will happen.

Contribute to existing languages
--------------------------------

.. youtube:: 10_Xfy5BOfQ
    :width: 100%

The first thing you will need to do in order to contribute is to create a free Weblate
account on this `page <https://hosted.weblate.org/accounts/register/>`_. More
information about profile settings can be found `here
<https://docs.weblate.org/en/latest/user/profile.html>`_.

Once you are signed in to Weblate, you can navigate to the `Flower Framework project
<https://hosted.weblate.org/projects/flower-docs/framework/>`_. Here, you should see the
different existing languages that can be found on the website.

Once you have selected the language you want to contribute to, you should see a similar
interface to this:

    .. image:: _static/weblate_status.png

The most straight forward option here is to click on the ``Translate`` button on the top
right (in the ``Translation status`` section). This will automatically bring you to the
translation interface for untranslated strings.

This is what the interface looks like:

    .. image:: _static/weblate_interface.png

You input your translation in the text box at the top and then, once you are happy with
it, you either press ``Save and continue`` (to save the translation and go to the next
untranslated string), ``Save and stay`` (to save the translation and stay on the same
page), ``Suggest`` (to add your translation to suggestions for other users to view), or
``Skip`` (to go to the next untranslated string without saving anything).

In order to help with the translations, you can see on the bottom the ``Nearby
strings``, the ``Comments`` (from other contributors), the ``Automatic suggestions``
(from machine translation engines), the translations in ``Other languages``, and the
``History`` of translations for this string.

On the right, under the ``String information`` section, you can also click the link
under ``Source string location`` in order to view the source of the doc file containing
the string.

For more information about translating using Weblate, you can check out this `in-depth
guide <https://docs.weblate.org/en/latest/user/translating.html>`_.

Add new languages
-----------------

If you want to add a new language, you will first have to contact us, either on `Slack
<https://flower.ai/join-slack>`_, or by opening an issue on our `GitHub repo
<https://github.com/adap/flower>`_.
