Internationalization
First of all, please go through the whole document unless instructed otherwise.
Datafisher has various IT systems and solutions, some of which are translated into more than 20 languages. Translating them might be a bit different than what you are used to – translation is done in a special system and all text is split into strings, most of which are only a phrase or a few sentences long. The strings may contain variables which, depending on their type, must be left as is or only a particular part of them translated. This is standard when translating IT systems, so learning to do it properly is also going to be useful elsewhere in the future.
Prerequisites (provided by Datafisher):
- Login credentials
- The project(s), component(s), and language(s) to translate and/or verify
- The type of strings to use (all, only untranslated, only needing review, etc)
Results:
- You learned how to use the translation system
In this section
- Weblate – the translation system and how to use it
- Variables – variables that could be present in the strings
- The ICU format – the ICU variable format
- ICU format helper – a tool to help with translating strings containing the ICU format variables
Weblate
Datafisher uses a system called Weblate to manage translations, located at https://wl.datafisher.org/.
In Weblate there are projects that consist of one or more components. The components contain the strings that need to be translated. As most of the projects you are translating are in active development, new strings are added all the time.
Weblate keeps track of who translated what, how many words were translated, and performs different verification checks to ensure that translations are valid.
Getting to the translation interface
In this example we will use "demo" as the user, "LMS" as the project, "admin" as the component, and "Estonian" as the language.
First, you need to go to https://wl.datafisher.org/ and log in.
Next, you need to select the project, component, and language you are going to translate.
You might already see the correct project, component, and language after you log in.
If you don't:
- select "Projects" from the top menu
- choose "Browse all projects"
- select the relevant project from the projects list
- select the relevant component from the components list
- select the relevant language from the languages list.
Next, you need to select the type of strings to process, this is provided by Datafisher.
You can select:
- All strings – contains everything
- Translated strings – contains only translated strings that are not marked as needing edit (verification)
- Unfinished strings – contains strings that are not translated or have been marked as needing edit (verification)
- Strings marked for edit – contains strings marked as needing editing (verification)
- Strings with any failing checks – contains strings that have potential errors
There are two translation interfaces available:
- The full interface where strings can be translated one by one
- The Zen interface that lists many strings on the same page and provides a potentially faster translation experience.
Click on the relevant link on the relevant string collection row to open the desired translation interface.
You should also see the "Glossary" component in the components list.
The glossary contains certain project-specific terms and their explanations to help translators and ensure that the terms are always translated the same way.
Before you start translating the actual components you must familiarize yourself with the glossary and find good translations for any terms that aren't translated there yet.
The full interface
This interface shows only a single string at a time.
You can see the English (or other source language) version at the top ("Documentation" in the sample), and need to write the translation into the box below it ("Dokumentatsioon" in the sample).
Sometimes the translation has already been done, and needs to be reviewed. In this case the "Needs editing" checkbox is checked. If you find that the translation is correct, uncheck it and continue to the next string. If you are unsure about the translation (e.g. due to the lack of context), you can also check it yourself to review it afterwards.
Once you are done, click on "Save and continue" to go to the next string. You can also use the arrows at the top to navigate between strings.
The Zen interface
This interface shows several strings at a time.
You can see the English (or other source language) version on the left, and need to write the translation into the box next to it.
Sometimes the translation has already been done, and needs to be reviewed. In this case the "Needs editing" checkbox is checked. If you find that the translation is correct, uncheck it and continue to the next string. If you are unsure about the translation (e.g. due to the lack of context), you can also check it yourself.
Once you are done, you can just move the cursor to the next box. You can also do it by pressing the TAB key and go to the previous translation by pressing SHIFT+TAB.
Variables
You might encounter two kinds of variables.
Firstly, simple variables, for example:
Hello, {name}!
In this case you must not change the yellow part, only translate the green parts.
Secondly, the ICU format strings, for example:
Enrollment closes { nr, plural, =1 {one hour} other {# hours} } before the event.
In this case you must only translate the green parts. More on this and a tool to help you to translate them below.
In both cases it might be useful to use the "Clone to translation" button to copy the English version into the translated box and then replace the English words with your language ones.
The ICU format
The ICU format is used to avoid re-translating many different variants of strings in case they contain numbers or variables.
For example, given the following:
Enrollment closes { nr, plural, =1 {one hour} other {# hours} } before the event.
The sentence can read in two ways depending on the number:
- Enrollment closes one hour before the event.
- Enrollment closes 5 hours before the event.
In some languages like Russian, Polish, Czech, Romanian, Ukranian, etc there are more variants:
- Запись заканчивается за час до мероприятия.
- Запись заканчивается за 2 часа до мероприятия.
- Запись заканчивается за 5 часов до мероприятия.
In that case the translated version would be:
Запись заканчивается за { nr, plural, =1 {час} few {# часа} other {# часов} } до мероприятия.
You can find the exact keys to be used in your language from here: https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html.
Additionally, there could be strings where an option is selected instead of numbers, for example:
A mandatory {type, select, assessment {assessment} feedback {feedback survey} other {assessment} } must be taken after the training.
The sentence can read in three ways depending on the type:
- A mandatory assessment must be taken after the training.
- A mandatory feedback survey must be taken after the training.
- A mandatory assessment must be taken after the training. (The standard requires a default option to be present, which is why in this case there is also an "other" option which duplicates the first one.)
For numeric selection, the text in orange signifies the amount that the text in the following curly brackets corresponds to:
- =1 – one, e.g. "one hour"
- few – used in languages like Russian, Polish, Czech, Romanian, Ukranian, etc for 2-4 hours, the # is replaced with the number
- other – all other cases, the # is replaced with the number
ICU format helper
Here is a little tool to help you with the translation of the ICU format strings.
English (source) version
Paste the English (source) version into the following box to view the available variants.
Variants
Please enter a valid ICU string with case selection into the box above.
Target version
Paste the English version into the following box, translate into the target language, and paste it back into Weblate. For languages that require the "few" option add it in case of a numeric selection (copy from here: few {# часа} ).
Variants
Please enter a valid ICU string with case selection into the box above.