translation.rst 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. .. _translation:
  2. ===========
  3. Translation
  4. ===========
  5. .. _weblate.bubu1.eu: https://weblate.bubu1.eu/projects/searxng/
  6. .. _Weblate: https://docs.weblate.org
  7. .. _translations branch: https://github.com/searxng/searxng/tree/translations
  8. .. _orphan branch: https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt---orphanltnewbranchgt
  9. .. _Weblate repository: https://weblate.bubu1.eu/projects/searxng/searxng/#repository
  10. .. _wlc: https://docs.weblate.org/en/latest/wlc.html
  11. .. |translated| image:: https://weblate.bubu1.eu/widgets/searxng/-/searxng/svg-badge.svg
  12. :target: https://weblate.bubu1.eu/projects/searxng/
  13. .. sidebar:: |translated|
  14. - Weblate_
  15. - SearXNG `translations branch`_
  16. - SearXNG `Weblate repository`_
  17. - Weblate Client: wlc_
  18. - Babel Command-Line: `pybabel <http://babel.pocoo.org/en/latest/cmdline.html>`_
  19. - `weblate workflow <https://docs.weblate.org/en/latest/workflows.html>`_
  20. Translation takes place on weblate.bubu1.eu_.
  21. Translations which has been added by translators on the weblate.bubu1.eu_ UI are
  22. committed to Weblate's counterpart of the SearXNG *origin* repository which is
  23. located at ``https://weblate.bubu1.eu/git/searxng/searxng``.
  24. There is no need to clone this repository, :ref:`SearXNG Weblate workflow` take
  25. care of the synchronization with the *origin*. To avoid merging commits from
  26. the counterpart directly on the ``master`` branch of *SearXNG origin*, a *pull
  27. request* (PR) is created by this workflow.
  28. Weblate monitors the `translations branch`_, not the ``master`` branch. This
  29. branch is an `orphan branch`_, decoupled from the master branch (we already know
  30. orphan branches from the ``gh-pages``). The `translations branch`_ contains
  31. only the
  32. - ``translation/messages.pot`` and the
  33. - ``translation/*/messages.po`` files, nothing else.
  34. .. _SearXNG Weblate workflow:
  35. .. figure:: translation.svg
  36. SearXNG's PR workflow to be in sync with Weblate
  37. Sync from *origin* to *weblate*: ``make babel.master.to.translations``
  38. For each commit on the ``master`` branch of SearXNG *origin* the GitHub job
  39. :origin:`babel / Update translations branch
  40. <.github/workflows/integration.yml>` checks for updated translations.
  41. Sync from *weblate* to *origin*: ``make babel.translations.to.master``
  42. Every Friday, the GitHub workflow :origin:`babel / create PR for additons from
  43. weblate <.github/workflows/translations-update.yml>` creates a PR with the
  44. updated translation files:
  45. - ``translation/messages.pot``,
  46. - ``translation/*/messages.po`` and
  47. - ``translation/*/messages.mo``
  48. wlc
  49. ===
  50. .. _wlc configuration: https://docs.weblate.org/en/latest/wlc.html#wlc-config
  51. .. _API key: https://weblate.bubu1.eu/accounts/profile/#api
  52. All weblate integration is done by GitHub workflows, but if you want to use wlc_,
  53. copy this content into `wlc configuration`_ in your HOME ``~/.config/weblate``
  54. .. code-block:: ini
  55. [keys]
  56. https://weblate.bubu1.eu/api/ = APIKEY
  57. Replace ``APIKEY`` by your `API key`_.