From e43e5af207580bab7aeb3b8d866a27b282babab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Sat, 18 Mar 2017 23:55:20 +0100 Subject: [PATCH 1/4] bump searx version to 0.11.0 --- docs/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 3ede3445..01249957 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,9 +57,9 @@ author = u'Adam Tauber' # built documents. # # The short X.Y version. -version = '0.10.0' +version = '0.11.0' # The full version, including alpha/beta/rc tags. -release = '0.10.0' +release = '0.11.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 1bd51c6de2f31ad15e5689ee7ff80f2283baa817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Sat, 18 Mar 2017 23:57:19 +0100 Subject: [PATCH 3/4] rewrite Translation page --- docs/dev/translation.rst | 87 ++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 53 deletions(-) diff --git a/docs/dev/translation.rst b/docs/dev/translation.rst index bc32eda9..ab4dd98c 100644 --- a/docs/dev/translation.rst +++ b/docs/dev/translation.rst @@ -1,80 +1,61 @@ Translation =========== -run these commands in the root directory of searx +Requirements +------------ -Add new language -~~~~~~~~~~~~~~~~ + * Transifex account -.. code:: shell + * Installed CLI tool of Transifex - pybabel init -i messages.pot -d searx/translations -l it +Init Transifex project +---------------------- -Update .po files -~~~~~~~~~~~~~~~~ - -.. code:: shell - - ./utils/update-translations.sh - -You may have errors here. In that case, edit the -``update-translations.sh`` script to change ``pybabel`` to -``pybabel-python2`` or ``pybabel2`` - -After this step, you can modify the .po files. - -Compile translations -~~~~~~~~~~~~~~~~~~~~ - -.. code:: shell - - pybabel compile -d searx/translations - -Transifex stuff -~~~~~~~~~~~~~~~ - -Init Project -^^^^^^^^^^^^ +After installing ``transifex`` using pip, run the following command to initialize the project. .. code:: shell tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/ + +After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it into the configuration file. + +Create a configuration file for ``tx`` named ``$HOME/.tx/config``. + +.. code:: shell + + [main] + host = https://www.transifex.com + [searx.messagespo] + file_filter = searx/translations//LC_MESSAGES/messages.po + source_file = messages.pot + source_lang = en + type = PO + + +Then run ``tx set``: + +.. code:: shell + tx set --auto-local -r searx.messagespo 'searx/translations//LC_MESSAGES/messages.po' \ --source-lang en --type PO --source-file messages.pot --execute -http://docs.transifex.com/client/init/ -http://docs.transifex.com/client/set/ +Update translations +------------------- -Get translations -^^^^^^^^^^^^^^^^ +To retrieve the latest translations, pull it from Transifex. .. code:: shell tx pull -a -http://docs.transifex.com/client/pull - -Upload source File -^^^^^^^^^^^^^^^^^^ +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. .. code:: shell - tx push -s + pybabel compile -d searx/translations -Upload all Translation -^^^^^^^^^^^^^^^^^^^^^^ -.. code:: shell - - tx push -s -t - -upload specifc Translation -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code:: shell - - tx push -t -l tr - -http://docs.transifex.com/client/push +After the compilation is finished commit the ``.po`` and ``.mo`` files and create a PR.