Warning Warning! This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans. See our page on recommended deployment patterns for more information.

Internationalization

This article outlines the approach to internationalization of labels and text rendered by the Question Editor API user interface and details the available labels for override, showing example markup.

Attribute paths for label bundles

When adding label bundles, you also need to specify an attribute path. As label bundles do not map exactly to attributes (e.g. there are labels for non-attributes like the add button and content of modal dialogs), the attribute paths for label bundles are slightly different from normal attribute paths. See the docs below for how to find label bundle paths. Each attribute in Question Editor API has a path. For example, the path for the below attribute is validation.valid_response.value[0][0].options.setThousandsSeparator[1].

Why do you need to know about attribute paths?

It's helpful to know the path of an attribute because it then allows you to hide/show/set the defaults for the attribute using question type templates.

Finding attribute paths

There are two ways to find attribute paths.

  • Use the debug global layout: if you initialize Question Editor API with debug as the global layout (refer to global layout docs for a guide), the attribute path is displayed above every input. This is the preferred option as it also shows you paths for sections which you can hide using hidden_sections.
    Here's an example:
  • Inspect the HTML: if you inspect the HTML, you'll note that the parent div of an input has the attribute data-lrn-qe-input-path.

Finding label bundle paths

To find the paths for label bundles, initialize Question Editor API with the label_bundle.debug flag set to true.

"label_bundle": {
    // debug flag
    "debug": true
}

This will reveal the paths for all label bundle keys on the page. You can override the label for any of these items using label_bundle config.