v7.3.0
SupportExamplesFree Trial

LocaleManager
Singleton

Singleton that handles switching locale. Locales can be included on page with <script> tags or loaded using ajax. When using script tags the first locale loaded is used per default, if another should be used as default specify it on any <script> tag with data-default-locale="En".

Example for Grid (to use for other products replace grid with product name):

index.html:

// Using Ecma 6 modules and source
<script type="module" src="lib/Core/localization/SvSE.js">

// Specify default locale when using bundled locales <script data-default-locale="En" src="build/locales/grid.locale.En.js"> <script src="build/locales/grid.locale.SvSE.js">

app.js:

// Import using sources
import LocaleManager from 'lib/Core/localization/LocaleManager.js';
// Or using module bundle
import { LocaleManager } from 'build/grid.module.js';

// Set locale using method LocaleManager.applyLocale('SvSE');

// Or set locale using string property LocaleManager.locale = 'SvSE';

// Or set locale using locale object property LocaleManager.locale = LocaleManager.locales.SvSE;

Useful properties and functions

Property / Function Description
locale Get or set the current locale
locales All registered locales
applyLocale Apply a locale by name

See also

Note: Class is a singleton and all members listed below can be accessed as static ones.

No results

Properties

Properties are getters/setters or publicly accessible variables on this class

    Functions

    Functions are methods available for calling on the class

      Events

      Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

      Event handlers

      Event handlers are callbacks called as a result of certain actions in this class

      Source path

      Core/localization/LocaleManager.js

      Demo

      examples/localization

      Contents