Submit a request
Submit a request

Configuring Items API to Initialize in RTL (Right-to-Left) Mode (Arabic and Hebrew Language Support)

The Items API (with assessment player) can be initialized to display content from right-to-left (RTL), to support languages such as Arabic.

This feature helps facilitate internationalization of the assessment player and assessments for languages that rely on RTL script.

Initializing Items API in RTL mode

Right-To-Left script mode has only minimal additional criteria on top of the regular initialization of Items API.

It requires a data attribute data-lrn-dir="rtl" to be added to the API script element:

<script src="[version]" 

In conjunction with the internationalization configurations available (compiled below), Items API with assessment player can be flexibly localized.

<span id="learnosity_assess"></span>
<script src="[version]" data-lrn-dir="rtl"></script>
var initOptions = {
"rendering_type": "assess",
"config": {
"labelBundle": {
// Here is where we can replace UI labels
// for the Assess player with key-value pairs
// (referenced below)
"questions_api_init_options": {
"labelBundle": {
// Here is where we can replace
// UI labels for Questions with
// key-value pairs (referenced below)
var itemsApp = LearnosityItems.init(initOptions);

Code Example 1: Items API Internationalization Configurations 


You can see the Learnosity RTL implementation on our demo site. 

Next steps

For more information, see the article about Configuring Author API in RTL mode, or Translating the Learnosity UI with Label Bundles

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.