fedora-docs / translations-scripts

Created a year ago
Maintained by asamalik
Scripts for the translations prototype https://taiga.fedorainfracloud.org/project/asamalik-antora-for-docs/epic/1
Members 2
Jean-Baptiste Holcroft committed 3 days ago

Fedora Docs internatialization

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:

How to run

Make sure Podman is installed on your system. You can install Podman using the following command:

$ sudo dnf install podman

Submitting sources for translation

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

Publish translated sources

$ cd translated-sources
$ git add.
$ git commit -m "automatic update of translated content"
$ git push

Rebuilding the translated website

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://pagure.io/fedora-docs/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/.