translation.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. _translation:
  2. ===========
  3. Translation
  4. ===========
  5. .. _searx@transifex: https://www.transifex.com/asciimoo/searx/
  6. Translation currently takes place on `searx@transifex`_
  7. Requirements
  8. ============
  9. * Transifex account
  10. * Installed CLI tool of Transifex
  11. Init Transifex project
  12. ======================
  13. After installing ``transifex`` using pip, run the following command to
  14. initialize the project.
  15. .. code:: sh
  16. tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/
  17. After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it
  18. into the configuration file.
  19. Create a configuration file for ``tx`` named ``$HOME/.tx/config``.
  20. .. code:: ini
  21. [main]
  22. host = https://www.transifex.com
  23. [searx.messagespo]
  24. file_filter = searx/translations/<lang>/LC_MESSAGES/messages.po
  25. source_file = messages.pot
  26. source_lang = en
  27. type = PO
  28. Then run ``tx set``:
  29. .. code:: shell
  30. tx set --auto-local -r searx.messagespo 'searx/translations/<lang>/LC_MESSAGES/messages.po' \
  31. --source-lang en --type PO --source-file messages.pot --execute
  32. Update translations
  33. ===================
  34. To retrieve the latest translations, pull it from Transifex.
  35. .. code:: sh
  36. tx pull -a
  37. Then check the new languages. If strings translated are not enough, delete those
  38. folders, because those should not be compiled. Call the command below to compile
  39. the ``.po`` files.
  40. .. code:: shell
  41. pybabel compile -d searx/translations
  42. After the compilation is finished commit the ``.po`` and ``.mo`` files and
  43. create a PR.