[fix] add missing transifex configuration (./tx/config)

BTW: update the documentation about transifex usage

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2021-07-03 19:31:31 +02:00
parent 0c256b378b
commit debcbab561
2 changed files with 14 additions and 6 deletions

7
.tx/config Normal file
View file

@ -0,0 +1,7 @@
[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

View file

@ -12,7 +12,6 @@ Requirements
============ ============
* Transifex account * Transifex account
* Installed CLI tool of Transifex
Init Transifex project Init Transifex project
====================== ======================
@ -22,7 +21,7 @@ initialize the project.
.. code:: sh .. code:: sh
tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/ ./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 After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it
@ -45,8 +44,9 @@ Then run ``tx set``:
.. code:: shell .. code:: shell
tx set --auto-local -r searx.messagespo 'searx/translations/<lang>/LC_MESSAGES/messages.po' \ ./manage pyenv.cmd tx set --auto-local \
--source-lang en --type PO --source-file messages.pot --execute -r searx.messagespo 'searx/translations/<lang>/LC_MESSAGES/messages.po' \
--source-lang en --type PO --source-file messages.pot --execute
Update translations Update translations
@ -56,7 +56,8 @@ To retrieve the latest translations, pull it from Transifex.
.. code:: sh .. code:: sh
tx pull -a ./manage pyenv.cmd tx pull -a
[?] Enter your api token: ....
Then check the new languages. If strings translated are not enough, delete those 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 folders, because those should not be compiled. Call the command below to compile
@ -64,7 +65,7 @@ the ``.po`` files.
.. code:: shell .. code:: shell
pybabel compile -d searx/translations ./manage pyenv.cmd pybabel compile -d searx/translations
After the compilation is finished commit the ``.po`` and ``.mo`` files and After the compilation is finished commit the ``.po`` and ``.mo`` files and