translation.rst 3.0 KB

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