This is a prototype of a multi-language Fedora Docs build pipeline. Work is tracked in https://fedoraproject.org/wiki/User:Jibecfed/fedoradoc-antora-localization.
The internatialization work with:
Make sure Podman is installed on your system. You can install Podman using the following command:
$ sudo dnf install podman
You can build the container image with Podman:
$ cd translations-scripts $ podman build . -t builder:latest
To run the build.py
script inside a container:
$ podman run builder:latest ./build.py [args]
Alternatively, you can mount your own local repository inside the container, for development purpose:
$ podman run -v ./:/workspace:Z builder:latest ./build.py [args]
Or you can open an interactive shell to tinker with:
$ podman run -it builder:latest /bin/bash
The buid.py
script will find list of repositories to be translated in the file site.yml from the the docs-fp-o repo.
It clones all of the specified source repositories, all of the matching translation repos,
and converts the English sources into POT files. The output of this script are local copies of the translation repos, updated with the newly generated POT files.
It takes the following arguments :
--clone_sources {true,false} Should we clone/update sources or use local content? --commit_l10n {true,false} Should we commit changes on l10n repos? --commit_tsources {true,false} Should we commit translated sources? --component COMPONENT Antora component to convert, all if unset
The buid.py
script will create three folders:
$(pwd)/sources
— Fedora Docs sources$(pwd)/l10n
— Translation repos$(pwd)/translated-sources
— Translated sources$ cd translated-sources $ git add. $ git commit -m "automatic update of translated content" $ git push
The official Fedora Docs docs-fp-o repo holds Antora playbooks for each language of the docs, and build scripts for each language.
Note: The playbooks are constructed manually and might not be up-to-date. Please make sure to update them based on the main site.yml
and the outputs in the translated sources repo.
Clone the repository, run a build of the translated sites (each language is its own site), and run a local preview:
$ git clone https://gitlab.com/fedora/docs/docs-website/docs-fp-o.git $ ./build-translated.sh $ ./preview.sh
Now you should be able to see, for example, the French site, on http://localhost:8080/fr/.
When you run the build.py process, an "errors.txt" file will be generated. It contains missing fedora-docs-l10n repositories.
Example data:
Process:
fedora-docs-l10n
fedora-docs-l10n
with commit rightsGo in Settings > Hooks:
Log in https://translate.fedoraproject.org, follow: Add > Add new translation project
fedora-docs-l10n/doc-example
fedora-docs-l10n-doc-example
CC-SA-3.0
po/(?P<language>[^/]*)/(?P<component>.*)\.po
{{ component }}
pot/{{ component }}.pot
^[^.]+$