diff options
author | Alexandre Flament <alex@al-f.net> | 2021-08-05 13:57:48 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-08-07 15:06:06 +0200 |
commit | 901ab87717f642f2ab5ce68ef0d01be38ca6726d (patch) | |
tree | 2a2ce9bddca9876b70bc7feaf140dd03c0291f05 /docs/dev/translation.rst | |
parent | 80372d87d9565a87d3929440100b2b19ad5a78af (diff) | |
download | searxng-901ab87717f642f2ab5ce68ef0d01be38ca6726d.tar.gz searxng-901ab87717f642f2ab5ce68ef0d01be38ca6726d.zip |
[translations] web integration
* make babel.translations.to.master: pull weblate updates
* make babel.master.to.translations: push .pot and .po files to weblate
Diffstat (limited to 'docs/dev/translation.rst')
-rw-r--r-- | docs/dev/translation.rst | 73 |
1 files changed, 25 insertions, 48 deletions
diff --git a/docs/dev/translation.rst b/docs/dev/translation.rst index 523dcf78c..be0cf5bef 100644 --- a/docs/dev/translation.rst +++ b/docs/dev/translation.rst @@ -4,69 +4,46 @@ Translation =========== -.. _searx@transifex: https://www.transifex.com/asciimoo/searx/ +.. _weblate.bubu1.eu: https://weblate.bubu1.eu/projects/searxng/ -Translation currently takes place on `searx@transifex`_ +Translation takes place on `weblate.bubu1.eu`_ ( `documentation <https://docs.weblate.org/en/latest/index.html>`_ ). -Requirements -============ +New messages on the master branch are extracted and pushed to Weblate automatically. -* Transifex account +Every Friday, a GitHub workflow creates a pull request with the updated translations (messages.mo, messages.po, messages.mo files). -Init Transifex project -====================== - -After installing ``transifex`` using pip, run the following command to -initialize the project. - -.. code:: sh - - ./manage pyenv.cmd tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/ - - -After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it -into the configuration file. - -Create a configuration file for ``tx`` named ``$HOME/.tx/config``. - -.. code:: ini - - [main] - host = https://www.transifex.com - [searx.messagespo] - file_filter = searx/translations/<lang>/LC_MESSAGES/messages.po - source_file = messages.pot - source_lang = en - type = PO +.. image:: https://weblate.bubu1.eu/widgets/searxng/-/searxng/svg-badge.svg + :target: https://weblate.bubu1.eu/projects/searxng/ +Weblate integration +=================== -Then run ``tx set``: +Weblate monitors the `translations branch <https://github.com/searxng/searxng/tree/translations>`_, not the master branch. -.. code:: shell +This branch contains only the .pot and pot files, nothing else. - ./manage pyenv.cmd tx set --auto-local \ - -r searx.messagespo 'searx/translations/<lang>/LC_MESSAGES/messages.po' \ - --source-lang en --type PO --source-file messages.pot --execute +Documentation +------------- +* `wlc <https://docs.weblate.org/en/latest/wlc.html>`_ +* `pybabel <http://babel.pocoo.org/en/latest/cmdline.html>`_ +* `weblate workflow <https://docs.weblate.org/en/latest/workflows.html>`_ -Update translations -=================== +Worfklow +-------- -To retrieve the latest translations, pull it from Transifex. +.. image:: translation.svg -.. code:: sh - ./manage pyenv.cmd tx pull -a - [?] Enter your api token: .... +wlc +--- -Then check the new languages. If strings translated are not enough, delete those -folders, because those should not be compiled. Call the command below to compile -the ``.po`` files. +All weblate integration is done by GitHub workflows, but if you want to use wlc, copy this content into `~/.config/weblate <https://docs.weblate.org/en/latest/wlc.html#wlc-config>`_ : -.. code:: shell +.. code-block:: ini - ./manage pyenv.cmd pybabel compile -d searx/translations + [keys] + https://weblate.bubu1.eu/api/ = APIKEY -After the compilation is finished commit the ``.po`` and ``.mo`` files and -create a PR. +Replace `APIKEY` by `your API key <https://weblate.bubu1.eu/accounts/profile/#api>`_. |