Language Enactor

Overview

Component Name: gpii.firstDiscovery.enactor.lang

File: enactors.js

Used to set the page's language by 1) saving the selected language to the settings store and 2) reloading the page. When the page reloads, it will automatically select the appropriate language based on the saved preference.

Using the Language Enactor

The Language Enactor should be bound to an instance of a Preferences Editor by supplying it in an Auxiliary Schema:

fluid.defaults("my.auxSchema", {
    auxiliarySchema: {
        "lang": {
            "type": "gpii.firstDiscovery.language",
            "enactor": {
                "type": "gpii.firstDiscovery.enactor.lang"
            }
        }
    }
});

Grades

This component uses the following base grades:

Model

This component supports the following model properties:

Path Description Values Default
lang The selected language A valid language code e.g.: "en-US", "fr-FR", "es-MX", "de-DE", "nl-NL", "sv-SE" "en-US"

Methods

Method Description Parameters
reloadPage Triggers a page reload. none

Members

Member Description Values Default
initialLangSet The state whether or not the initial language was set. This is to prevent a page reload on initialization Boolean false

Dependencies

<script type="text/javascript" src="src/lib/infusion/infusion-custom.js"></script>
<script type="text/javascript" src="src/js/enactors.js"></script>