summaryrefslogtreecommitdiff
path: root/docs/dev/translation.rst
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2019-12-12 11:19:26 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2019-12-12 11:19:26 +0100
commit49e8dd1e0dbce9b06a3a4ad2de6fc0e1d95eb49b (patch)
tree9b947e35abc9325c0c75fff77ec78b7d83a543e3 /docs/dev/translation.rst
parent3f93fe04d8c43191cc3bff51c9add1c35728c789 (diff)
parent61e9b0b75f9fabb4e50eddcd1aed6592fd2569bd (diff)
doc: move patches from /doc folder of branch gh-pages to master
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs/dev/translation.rst')
-rw-r--r--docs/dev/translation.rst61
1 files changed, 61 insertions, 0 deletions
diff --git a/docs/dev/translation.rst b/docs/dev/translation.rst
new file mode 100644
index 000000000..ab4dd98cb
--- /dev/null
+++ b/docs/dev/translation.rst
@@ -0,0 +1,61 @@
+Translation
+===========
+
+Requirements
+------------
+
+ * Transifex account
+
+ * Installed CLI tool of Transifex
+
+Init Transifex 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/<lang>/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/<lang>/LC_MESSAGES/messages.po' \
+ --source-lang en --type PO --source-file messages.pot --execute
+
+
+Update translations
+-------------------
+
+To retrieve the latest translations, pull it from Transifex.
+
+.. code:: shell
+
+ tx pull -a
+
+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
+
+ pybabel compile -d searx/translations
+
+
+After the compilation is finished commit the ``.po`` and ``.mo`` files and create a PR.