on master help sign in
Merge pull request #879 from kvch/gh-pages

[doc] bump version to 0.11 && rewrite Translation page

commit82a016dcb48b81c3a2a88387a2d23fd1eb086a7b authorAdam Tauber <asciimoo@gmail.com> dateSun 19 Mar 2017, 00:16 (10 years ago) parent9a9ff79b1dc639
2 files changed+27−46
docs/conf.py+2−2 docs/dev/translation.rst+25−44
docs/conf.py+2−2
@@ -57,9 +57,9 @@ author = u'Adam Tauber'
5757# built documents.
5858#
5959# The short X.Y version.
60−version = '0.10.0'
60+version = '0.11.0'
6161# The full version, including alpha/beta/rc tags.
62−release = '0.10.0'
62+release = '0.11.0'
6363
6464# The language for content autogenerated by Sphinx. Refer to documentation
6565# for a list of supported languages.
docs/dev/translation.rst+25−44
@@ -1,80 +1,61 @@
11Translation
22===========
33
4−run these commands in the root directory of searx
4+Requirements
5+------------
56
6−Add new language
7−~~~~~~~~~~~~~~~~
7+ * Transifex account
88
9−.. code:: shell
9+ * Installed CLI tool of Transifex
1010
11− pybabel init -i messages.pot -d searx/translations -l it
11+Init Transifex project
12+----------------------
1213
13−Update .po files
14−~~~~~~~~~~~~~~~~
14+After installing ``transifex`` using pip, run the following command to initialize the project.
1515
1616.. code:: shell
1717
18− ./utils/update-translations.sh
18+ tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/
1919
20−You may have errors here. In that case, edit the
21−``update-translations.sh`` script to change ``pybabel`` to
22−``pybabel-python2`` or ``pybabel2``
2320
24−After this step, you can modify the .po files.
21+After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it into the configuration file.
2522
26−Compile translations
27−~~~~~~~~~~~~~~~~~~~~
23+Create a configuration file for ``tx`` named ``$HOME/.tx/config``.
2824
2925.. code:: shell
3026
31− pybabel compile -d searx/translations
27+ [main]
28+ host = https://www.transifex.com
29+ [searx.messagespo]
30+ file_filter = searx/translations/<lang>/LC_MESSAGES/messages.po
31+ source_file = messages.pot
32+ source_lang = en
33+ type = PO
3234
33−Transifex stuff
34−~~~~~~~~~~~~~~~
3535
36−Init Project
37−^^^^^^^^^^^^
36+Then run ``tx set``:
3837
3938.. code:: shell
4039
41− tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/
42−
4340 tx set --auto-local -r searx.messagespo 'searx/translations/<lang>/LC_MESSAGES/messages.po' \
4441 --source-lang en --type PO --source-file messages.pot --execute
4542
46−http://docs.transifex.com/client/init/
4743
48−http://docs.transifex.com/client/set/
44+Update translations
45+-------------------
4946
50−Get translations
51−^^^^^^^^^^^^^^^^
47+To retrieve the latest translations, pull it from Transifex.
5248
5349.. code:: shell
5450
5551 tx pull -a
5652
57−http://docs.transifex.com/client/pull
58−
59−Upload source File
60−^^^^^^^^^^^^^^^^^^
61−
62−.. code:: shell
63−
64− tx push -s
65−
66−Upload all Translation
67−^^^^^^^^^^^^^^^^^^^^^^
53+Then check the new languages. If strings translated are not enough, delete those folders, because
54+those should not be compiled. Call the command below to compile the ``.po`` files.
6855
6956.. code:: shell
7057
71− tx push -s -t
72−
73−upload specifc Translation
74−~~~~~~~~~~~~~~~~~~~~~~~~~~
75−
76−.. code:: shell
58+ pybabel compile -d searx/translations
7759
78− tx push -t -l tr
7960
80−http://docs.transifex.com/client/push
61+After the compilation is finished commit the ``.po`` and ``.mo`` files and create a PR.