Translations Process#

Overview#

The Open edX Platform supports running in multiple languages. This page explains the process by which we accomplish this. To begin with, your code needs to annotate strings so tooling can know that you want those strings translated. The tooling needs to extract those strings in order to be shared with translators. Once the strings have been extracted and made available to translators, strings can be translated to a variety of languages. Tooling will then download the translated strings and make them available to your running code.

        flowchart TD
   annotate(Annotate Strings) -->
   extract(Extract Source Strings for Translation) -->
   upload(Upload Source Strings to Transifex) -->
   translate(Translate Strings) -->
   sync(Sync Translated Strings to openedx-translations) -->
   use(Using Translation)
    

Annotating and Extracting Strings#

Given code like this:

from django.utils.translation import ugettext as _

# Translators: This will help the translator
message = _("Welcome!")

# Translators: This is a very long comment that needs to wrap
# over multiple lines because it would be too long otherwise.
message = _("Hello world")

Our tooling will extract the following strings:

  • Welcome!

  • Hello world

A similar process to the one noted above occurs in our Javascript frontend code as well. For our django backed services, we use django’s builtin translation tooling to extract strings for translation. In our React based frontends, we use react-intl to extract strings for translation.

To learn more about how to annotate strings for translation, see the annotation reference (link tbd).

The extraction process is managed by the openedx-translations repository which stores the English source translations in git.

Getting Strings Translated#

The tool we use to translate strings is Transifex. Once translation source strings are extracted from code to files, the GitHub Transifex App will upload the soruce translations to Transifex so translators can do their work.

Translation is done by the community and coordinated by the Translations Working Group. For more information see Quick Start: How to start translating for Open edX.

Using Translations#

In order to use translated strings, they must be downloaded as files. Translation files are automatically synced into the openedx-translations repository by the GitHub Transifex App.

The openedx-atlas CLI tool has been built to help you download translation files for a specific part of the codebase. This process is automated and included in the Tutor Dockerfile.

During development, it is possible to download the latest files into a repositories source code e.g. edx-platform or frontend-app-learning by running the make pull_translations command in the desired repository’s source code.

The specifics the Makefile program and atlas pull parameters are described in details in the Enabling Translations on a New Repo document.

Once the translations have been downloaded, you can simply start up the service and the translations will be available to the user based on their profile settings.

Maintenance chart

Review Date

Working Group Reviewer

Release

Test situation