Skip to content

Commit 8129646

Browse files
committed
Add info on Transifex integration to the README
1 parent 02a168a commit 8129646

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,68 @@ Please carefully read these guidelines before submitting a pull request.
126126
- [jQuery 1.7] - javascript helper library
127127
- [jQuery ToC MD Generator] - renders header menu on documentation section
128128

129+
Translation
130+
------------
131+
132+
Documentation translation is done using Transifex platform: https://www.transifex.com/otf/qubes/
133+
The `_translated` directory should not be modified manually. Any manual change
134+
there **will be overriden** with the content downloaded from Transifex.
135+
136+
The `qubes-translated` repository is not signed and generally should not be
137+
considered trusted for sensitive tasks. But the specific commit referenced from
138+
this repository is validated to not interfere with English website.
139+
140+
### Transifex integration details ###
141+
142+
Most of the integration is automated. It is split into few parts:
143+
144+
1. `_utils/transifex-push` script takes the source (English) content and
145+
uploads to Transifex. The platform merges existing translations to the new
146+
files, so unchanged parts that were translated before remain translated.
147+
Transifex configuration is created from scratch here, to correctly handle
148+
new/removed files.
149+
150+
2. `_utils/transifex-pull` pulls translated content and places into
151+
`_translated` submodule. Then a set of scripts in
152+
`_utils/_translation_utils` perform various post processing steps,
153+
including:
154+
- validate syntax of retrieved files (if frontmatter is still correctly set etc)
155+
- modify frontmatter settings (`permalink`, `lang`, `redirect_from` etc) to
156+
match the page language
157+
- adjust all internal links to point at pages in the same language
158+
- run htmlproofer to verify if no broken links were introduced
159+
160+
At the end, the script commit and push the new content to qubes-translated
161+
repository.
162+
163+
3. `_utils/update-translated` fetches new version of qubes-translated repo (its
164+
master branch), verifies if any page doesn't try to subvert English version,
165+
and if all is fine, makes a commit and push updated submodule (similar to
166+
`_utils/update-submodules` script).
167+
168+
The points 1 and 2 are running in Gitlab CI environment, without access to any
169+
signing key and with push access only to qubes-translated repository. The third
170+
point is running in a more trusted environment, with access to signing key and
171+
push access to the main repository.
172+
173+
### Language switcher ###
174+
175+
The top level `_config.yml` file contains list of languages to be enabled. If
176+
there is more than one (`en`), each page will have a language switch menu in
177+
the top right corner. Only languages listed in `_config.yml` are visible in the
178+
switcher, but there may be more available (accessing them require manually
179+
changing language code in the URL).
180+
181+
Each markdown file in the repo has `lang` and `ref` attributes (in its
182+
frontmatter). `lang` attribute contains the language of this file
183+
(should always be `en` outside of qubes-translated repository) and `ref`
184+
contains a unique identifier of that page. Language switcher logic uses the
185+
`ref` attribute to find all translations of given page. This allows translated
186+
page to have different page name in URL, although we do not do this right now.
187+
188+
`lang` and `ref` attributes are added with
189+
`_utils/_translation_utils/prepare_for_translation.py` script.
190+
129191
Deprecated Documentation
130192
------------------------
131193

0 commit comments

Comments
 (0)