Multi language support

By default the widget will use the market configured language. If you want to support multiple languages, you will need to specify which languages are supported and which language is selected by default.

For selected language, you can either use the language code or the SYSTEM_DEFAULT value. When using the SYSTEM_DEFAULT value, the widget will use the user’s browser language if it is supported. Otherwise it will use the first language in the languages array.

const configurationOverrides = {
  ...
  languages: ["sv-SE", "en-GB"],
  selectedLanguage: "SYSTEM_DEFAULT",
  ...
}

Supported language codes

[
    "en-GB",
    "fi-FI",
    "lt-LT",
    "sk-SK",
    "sv-SE",
    "sv-FI",
    "de-AT"
]

Trigger language change

As of v4.2.0 it is possible to trigger a language change from outside the widget via the switchLanguage function available in the EconansGreenHousing object. Provide the desired language as argument, e.g:

EconansGreenHousing.switchLanguage("en-GB");