Skip to content

Commit

Permalink
Add rst docs to Crowdin (#1355)
Browse files Browse the repository at this point in the history
- create upload-translations action
- move pot files to proper destination
- add crowdin.yaml config file
- add update-pot and update-po commands
- add sphinx-intl to requirements.txt for update-po

Closes #1325
  • Loading branch information
artembo authored Mar 31, 2021
1 parent ec19bb1 commit b9ed733
Show file tree
Hide file tree
Showing 11 changed files with 354 additions and 114 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/upload-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update translation sources

on:
workflow_dispatch:
pull_request:
paths:
- 'rst/**.rst'
jobs:
autocommit-pot-files:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Setup tarantool
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: '2.6'

- name: Setup Python environment
uses: actions/setup-python@v2

- name: Setup Python requirements
run: |
python -m pip install --upgrade pip
pip install -r rst/requirements.txt
- name: Create Makefile
run: cmake .

- name: Update pot files
run: make update-pot

- name: Push Local Changes
uses: stefanzweifel/[email protected]
with:
commit_message: "Update translation sources"
file_pattern: "*.pot"

- name: Push Pot-files to crowdin
uses: crowdin/[email protected]
with:
upload_sources: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,26 @@ add_custom_command(
VERBATIM
)

add_custom_target(update-pot
COMMAND "${SPHINX}"
"${CMAKE_CURRENT_BINARY_DIR}/rst"
"${CMAKE_CURRENT_BINARY_DIR}/rst/locale/en/"
-c rst/
-d "${CMAKE_CURRENT_BINARY_DIR}/.doctrees"
-b gettext
COMMENT "Generate localization templates"
)

add_custom_target(update-po
COMMAND "sphinx-intl"
update
-p "${CMAKE_CURRENT_BINARY_DIR}/rst/locale/en/"
-d "${CMAKE_CURRENT_BINARY_DIR}/rst/locale/"
-l "ru"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Regenerate localization files from templates"
)

if(Ldoc_FOUND AND Sphinx_FOUND)
add_custom_target(doc ALL
DEPENDS "${DOC_OUTPUT}/index.html")
Expand Down
24 changes: 24 additions & 0 deletions crowdin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# https://support.crowdin.com/configuration-file/
# https://support.crowdin.com/cli-tool-v3/#configuration

"project_id" : "447872"
"base_path" : "./rst/locale"
"base_url": "https://crowdin.com"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"


"preserve_hierarchy": true

files: [
{
"source" : "/en/**/*.pot",
"translation" : "/%locale_with_underscore%/LC_MESSAGES/**/%file_name%.po",
"update_option" : "update_as_unapproved",

"languages_mapping" : {
"locale_with_underscore" : {
"ru" : "ru",
}
},
}
]
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C)
# This file is distributed under the same license as the Cartridge package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Cartridge 2.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-30 08:01+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Administrator's guide"
msgstr ""
Expand Down Expand Up @@ -643,4 +660,3 @@ msgstr ""

msgid "Please see the `backups section <https://www.tarantool.io/en/doc/latest/book/admin/backups/>`_ in the Tarantool manual."
msgstr ""

45 changes: 40 additions & 5 deletions rst/locale/cartridge_dev.pot → rst/locale/en/cartridge_dev.pot
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C)
# This file is distributed under the same license as the Cartridge package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Cartridge 2.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-30 08:01+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Developer's guide"
msgstr ""
Expand Down Expand Up @@ -680,6 +697,18 @@ msgstr ""
msgid "In the ``eventual`` mode, the leader isn't elected consistently. Instead, every instance in the cluster thinks that the leader is the first **healthy** instance in the failover priority list, while instance health is determined according to the membership status (the SWIM protocol)."
msgstr ""

msgid "The member is considered healthy if both are true:"
msgstr ""

msgid "It reports either ``ConfiguringRoles`` or ``RolesConfigured`` state;"
msgstr ""

msgid "Its SWIM status is either ``alive`` or ``suspect``."
msgstr ""

msgid "A ``suspect`` member becomes ``dead`` after the ``failover_timout`` expires."
msgstr ""

msgid "Leader election is done as follows. Suppose there are two replica sets in the cluster:"
msgstr ""

Expand Down Expand Up @@ -728,7 +757,7 @@ msgstr ""
msgid "If there is no leader appointed for the replica set, the coordinator appoints the first leader according to the failover priority, regardless of the SWIM status."
msgstr ""

msgid "If a leader becomes degraded, the coordinator makes a decision. A new leader is the first healthy instance from the failover priority list. If an old leader recovers, no leader change is made until the current leader down. Changing failover priority doesn't affect this."
msgid "If a leader becomes ``dead``, the coordinator makes a decision. A new leader is the first healthy instance from the failover priority list. If an old leader recovers, no leader change is made until the current leader down. Changing failover priority doesn't affect this."
msgstr ""

msgid "Every appointment (self-made or fetched) is immune for a while (controlled by the ``IMMUNITY_TIMEOUT`` option)."
Expand Down Expand Up @@ -797,19 +826,25 @@ msgstr ""
msgid "``state_provider``: \"tarantool\" / \"etcd\"."
msgstr ""

msgid "``failover_timeout`` -- time (in seconds) to mark ``suspect`` members as ``dead`` and trigger failover (default: 20)."
msgstr ""

msgid "``tarantool_params``: ``{uri = \"...\", password = \"...\"}``."
msgstr ""

msgid "``etcd2_params``: ``{endpoints = {...}, prefix = \"/\", lock_delay = 10, username = \"\", password = \"\"}``."
msgstr ""

msgid "``fencing_pause`` -- the period of performing the check;"
msgid "``fencing_enabled``: ``true`` / ``false`` (default: false)."
msgstr ""

msgid "``fencing_timeout`` -- time to actuate fencing after the check fails (default: 10)."
msgstr ""

msgid "``fencing_timout`` -- time to actuate fencing after the check fails;"
msgid "``fencing_pause`` -- the period of performing the check (default: 2)."
msgstr ""

msgid "It's required that ``fencing_timeout > fencing_pause``."
msgid "It's required that ``failover_timeout > fencing_timeout >= fencing_pause``."
msgstr ""

msgid "Lua API"
Expand Down Expand Up @@ -1214,7 +1249,7 @@ msgstr ""
msgid "``--cfg FILE``"
msgstr ""

msgid "Cartridge instances YAML configuration file. Defaults to ``TARANTOOL_CFG`` or ``./instances.yml``."
msgid "Cartridge instances YAML configuration file. Defaults to ``TARANTOOL_CFG`` or ``./instances.yml``. The ``instances.yml`` file contains ``cartridge.cfg()`` parameters described in the :ref:`configuration section <cartridge-config-basic>` of this guide."
msgstr ""

msgid "``--foreground``"
Expand Down
File renamed without changes.
29 changes: 29 additions & 0 deletions rst/locale/en/index.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C)
# This file is distributed under the same license as the Cartridge package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Cartridge 2.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-30 08:01+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Tarantool Cartridge"
msgstr ""

msgid "**Cluster** management in Tarantool is powered by the Tarantool Cartridge framework."
msgstr ""

msgid "Here we explain how you can benefit with Tarantool Cartridge, a framework for developing, deploying, and managing applications based on Tarantool."
msgstr ""

msgid "This documentation contains the following sections:"
msgstr ""
Loading

0 comments on commit b9ed733

Please sign in to comment.