Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multilanguage support and GitHub Actions #3829

Open
wants to merge 10 commits into
base: rolling
Choose a base branch
from

Conversation

cychitivav
Copy link
Contributor

As discussed in #3249, the support for multiple languages is a barrier that we can eliminate in the ROS learning curve. To address this, I have put forward a solution in #3678, building upon the feedback from the previous issue and as discussed with @clalancette. I am opening this PR for review, and I welcome any suggestions or comments to further enhance the proposal.

Process

To translate rst files, some tools are used following the following process:

image

This process can be somewhat simplified with the help of the sphinx-intl library:

  1. Upload .rst files with the documentation in English.
  2. Generate a .pot file from the .rst files using make gettext (these files would be stored in the build folder).
  3. Update the .po files with the .pot files using sphinx-intl update -p build/locale -l <language>.
  4. Translate the .po files manually or with the assistance of a translator.
  5. Build the documentation in the desired language using make -e SPHINXOPTS="-D language='<language>'" html (the output would be stored in the build/<language> folder).

File handling is better described in #3678, but I am still willing to answer questions or concerns in this PR.

@cychitivav
Copy link
Contributor Author

I have finished the configurations. Now I just have a few considerations:

  • Running the commands make multiversion and make html remains the same. I only added a new variable LANG to specify the language. However, by default, it's set to English, so running them without specifying the language will work as before.
  • An adjustment needs to be made in the pages to separate the compiled files for each language. The pages are created in build/html/<language>, so the adjustment needs to be made in Jenkins (I don't know how it works) and wherever the html folder path is used.
  • To test the multilanguage feature, just follow these three steps:
    1. Generate the .pot files with make gettext
    2. Generate the .po files for each language with make update po LANG=<language>
    3. Generate the HTML files with make html LANG=<language>

Note: Currently, the make multiversion command doesn't work in different languages because it takes files from the ROS branches (rolling, iron, etc.). But once the change is uploaded to the rolling branch and backported, all branches will load the translations.
If you want to test multiversion, you need to add the multilanguage branch to smv_branch_whitelist and add multiversion to the distro_full_names dictionary in the conf.py file.

@cychitivav cychitivav marked this pull request as ready for review August 19, 2023 14:24
@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/translation-of-ros-industrial-training/33239/1

With gettext, it is posible to avoid translating twice the same
content (see locale/es/LC_MESSAGES/Installation.po:1160)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants