Submit a request
Submit a request

Translating the Learnosity user interface with label bundles

This article explains how to launch the Learnosity interface in different language modes, and how content for translations is handled. 

What parts of Learnosity can be translated?

There are two main tasks to using Learnosity with another language:

1. User interface label bundles
The text in the Learnosity user interface can be shown in another language using label bundles. If a bundle exists for your chosen language, you can simply change the language bundle. Otherwise, you may need to do some translation to create a new language bundle.

2. Content in your Item bank
All content in your Item bank, including Questions, Items and Activities must be manually translated, separately.  All translations must be done ahead of time, and should be saved separately from the English versions. Note: there is no "just in time" translation feature in Learnosity. 

Setting up a translation of Learnosity in a language other than English

By default, the Learnosity interface shows all text in English: United States (en-US) mode. You can select another language from the label bundles provided in our internationalization repository.

Currently, Learnosity offers label bundles in the following languages:

  • English: United States (en-US),
  • English: United Kingdom (en-UK),
  • Spanish: Spain (es-ES),
  • French: France (fr-FR),
  • German: Germany (de-DE),
  • Italian: Italy (it-IT),
  • Arabic: Egypt (ar-EG),
  • Tagalog / Filipino: Phillipines (tl-PH), and
  • Russian: Russia (ru-RU).

Selecting a language and label bundle

In your application code, when you first initialize the Learnosity API, you can call one or more label bundles, as explained on our documentation page.

Broadly, you will need to take the following steps:

  1. Go and download the desired language label bundle files from our official repository. Store those where your application can reach them. 
  2. Configure your initialization options to load those files and set up the request object to select the language.

Code examples

There are two main approaches for setting up the request object.

Create an object in an array

You can create an object in an array (better for cross-language comprehension):

...
'labelBundle' => array(
'actionsave' => 'guardar',
'actionsubmit' => 'enviar',
...
)
...

Load the bundles in a string

Alternatively, load the bundles in a string, as a JSON object, and then decode it, to turn it into an array:

...
if (isset($_GET['language'])) {
$language = $_GET['language'];
if ($language !== 'en-US') {
$url = 'https://raw.githubusercontent.com/Learnosity/learnosity-i18n/master/languages/' . $language;
$assessLabels = file_get_contents($url . '/assess-api.json');
}
}
...
$request = [
...
'labelBundle' => json_decode($assessLabels, true),
...
];
...

More details on this page: Internationalizing and Localizing the Assessment Experience.

Translating the content in your Item bank

As mentioned above, content in your Item banks will need to be translated. We suggest using ISO suffixes when naming content in your Item bank. For example, if you have an item called "i18n_item1_en-US", where "en-US" stands for "English spoken in the United States", if you make a copy of this Item and then translate its content into Spanish, you could use the name "i18n_item1_es-ES" (where the "es-ES" suffix at the end of the reference indicates "Spanish spoken in Spain"). 

Read more about ISO language suffixes.

Adding a new language label bundle to our public repository

Visit our public Github repository to find out how to contribute to the Learnosity language translations. Learnosity is open to additions from the community and industry. For major changes, please open a support ticket first to discuss what you would like to change.

Demo showing Learnosity in different languages

The Learnosity internationalization demo uses the available label bundles, and pre-translated Question content for each language. Note, Learnosity does not have an on-the-fly translation feature. For each language shown in the demo, there are the following elements:

  • A pre-translated label bundle for the user interface text,
  • Three pre-translated Items in the Item bank, and
  • A pre-translated Activity in the Item bank.

All of these elements are shown together for a complete translation.

Try the internationalization demo for yourself.

Related Links

 

Was this article helpful?
0 out of 0 found this helpful

Did you arrive here by accident? If so, learn more about Learnosity by clicking here.