Internationalization
Overview
Configuration Variables
window.config.i18n = {
enabled: true, // If your app uses multiple languages, then set to true.
languages: { // List of languages your app supports, this is used to load translations and populate language selector widgets.
en: {
name: 'English',
slug: 'english',
code: 'en',
locale: 'en-UK',
dir: 'ltr',
flag: 'https://flagcdn.com/gb.svg'
},
hi: {
name: 'Hindi',
slug: 'hindi',
code: 'hi',
locale: 'hi-IN',
dir: 'ltr',
flag: 'https://flagcdn.com/in.svg'
},
ar: {
name: 'Arabic',
slug: 'arabic',
code: 'ar',
locale: 'ar-AE',
dir: 'rtl',
flag: 'https://flagcdn.com/ae.svg'
}
},
defaultLanguage: 'en', // This is the default or primary language of your app.
fallbackLanguage: 'en', // In case, if translations are not present in JSON files, then the string is translated into fallback language.
namespaces: ['common'] // These are the i18n JSON translation files without the suffix .json
}Set Primary Language
Language Switcher
i18n Related Methods
app.i18n.initialize();
app.i18n.initialize();app.i18n.currentLanguage();
app.i18n.currentLanguage();app.i18n.changeLanguage(languageCode);
app.i18n.changeLanguage(languageCode);app.i18n.localize();
app.i18n.localize();app.i18n.translate(key, fallback, options);
app.i18n.translate(key, fallback, options);languageChanged Event
languageChanged EventLast updated