- 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
Makefile
file in theTRANSLATIONS
variable. - the
lizmap_versions.json
in thelocales
variable. - the
update_from_transifex.sh
inAVAILABLE_LOCALES
variable. - the
.gitlab-ci.yml
inretrieve_po_and_build
stage.
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.py
aboutX.Y
, mainly therelease
without 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.py
andsource/lizmap_versions.json
- Push the new branch and the master branch
- In the server configuration, change the target of the symbolic link 'current'
- Copy the
source/lizmap_versions.json
into all maintained branches, it should be the same for all.
- Checkout the branch
./update_from_transifex.sh -f
git commit -am 'Archive LWC BRANCH translations, EOL'
- Remove all ressources on Transifex for the BRANCH
- Update
source/lizmap_versions.json
to 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.py
git commit -am 'The branch is now outdated'
- Adapt the CI on the
master
branch about branches