- Use RST substitutions : http://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#default-substitutions
- Use Lizmap substitutions : check the file
substitutions.rst
We are using Transifex, and so you will need their CLI tool to push or pull translations.
It is recommended to install Sphinx into a dedicated Python environment. For example:
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
To install Transifex, see https://developers.transifex.com/docs/cli. For linux, the fastest way:
cd /tmp; \
curl -L "https://github.com/transifex/cli/releases/latest/download/tx-linux-amd64.tar.gz" | tar xz --skip-old-files; \
sudo mv tx /usr/local/bin/tx
You should create a ~/.transifexrc file containing:
[https://www.transifex.com]
api_hostname = https://api.transifex.com
hostname = https://www.transifex.com
rest_hostname = https://rest.api.transifex.com
username = api
password =
token
In the password parameter and in the token parameter, you should set an API Key you have to generate from your Transifex account.
You must first generate the .pot files, from the .rst files:
make gettext
Then you push them to Transifex
./push_to_transifex.sh
It is not recommended modifying by hand files into i18n/! We prefer to
translate strings into Transifex.
To retrieve translated string:
./update_from_transifex.sh -f
You can then commit them.
The language should be created into Transifex. When there are enough translated
strings, you can download translated files with tx pull. See above.
Update the list of available language into :
- the
Makefilefile in theTRANSLATIONSvariable. - the
lizmap_versions.jsonin thelocalesvariable. - the
update_from_transifex.shinAVAILABLE_LOCALESvariable. - the
.gitlab-ci.ymlinretrieve_po_and_buildstage.
When a new major version of lizmap has been released, be sure the documentation
is updated into the master branch.
When the documentation is ready to release X.Y from the master branch:
- Set the version number into
source/conf.pyaboutX.Y, mainly thereleasewithout the suffix. - Update the file
source/lizmap_versions.json - Update gitlab-ci about this new branch
- Commit these 3 files :
Release version X.Y - Create a new branch
git checkout -b lizmap_X_Y(replace X and Y). - Configure a new schedule in the CI configuration for this new branch
- On the master branch, set the next version into
source/conf.pyandsource/lizmap_versions.json - Push the new branch and the master branch
- In the server configuration, change the target of the symbolic link 'current' variable
webpublic_docslizmap_current_versionin "server-bootstrap" - Copy the
source/lizmap_versions.jsoninto all maintained branches, it should be the same for all.
- Checkout the branch
./update_from_transifex.sh -fgit commit -am 'Archive LWC BRANCH translations, EOL'- Remove all ressources on Transifex for the BRANCH
- Update
source/lizmap_versions.jsonto add a single link to the current branch, see a branch below, like 3.4 git commit -am 'Add single link to the current maintained branch'sed -i 's/\'outdated\': False,/\'outdated\': True,/g' source/conf.pygit commit -am 'The branch is now outdated'- Adapt the CI on the
masterbranch about branches