1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-19 02:40:11 +01:00
searxng/docs/dev/translation.rst

62 lines
1.4 KiB
ReStructuredText
Raw Normal View History

2015-11-17 23:13:30 +01:00
Translation
===========
2017-03-18 23:57:19 +01:00
Requirements
------------
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
* Transifex account
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
* Installed CLI tool of Transifex
2017-03-18 23:57:19 +01:00
Init Transifex project
----------------------
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
After installing ``transifex`` using pip, run the following command to initialize the project.
2015-11-17 23:13:30 +01:00
.. code:: shell
2017-03-18 23:57:19 +01:00
tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it into the configuration file.
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
Create a configuration file for ``tx`` named ``$HOME/.tx/config``.
2015-11-17 23:13:30 +01:00
.. code:: shell
2017-03-18 23:57:19 +01:00
[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
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
Then run ``tx set``:
2015-11-17 23:13:30 +01:00
.. code:: shell
tx set --auto-local -r searx.messagespo 'searx/translations/<lang>/LC_MESSAGES/messages.po' \
--source-lang en --type PO --source-file messages.pot --execute
2017-03-18 23:57:19 +01:00
Update translations
-------------------
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
To retrieve the latest translations, pull it from Transifex.
2015-11-17 23:13:30 +01:00
.. code:: shell
tx pull -a
2017-03-18 23:57:19 +01:00
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.
2015-11-17 23:13:30 +01:00
.. code:: shell
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
pybabel compile -d searx/translations
2015-11-17 23:13:30 +01:00
2017-03-18 23:57:19 +01:00
After the compilation is finished commit the ``.po`` and ``.mo`` files and create a PR.