$.li18n.currentLocale = 'xxx';
Default is "en"
.
$.li18n.translations = {en: {spam: 'eggs'}};
Default is {}
.
$.li18n.translate(key, interpolationOptions);
Params:
- key - translation lookup key (String).
- interpolationOptions - options for translations with interpolation (Object).
Returns:
- translation if found (String) (by default).
- error message (String) if translation not found and $.li18n.onTranslationMissing is set to 'message'.
- value from
$.li18n.onTranslationMissing if translation not found and $ .li18n.onTranslationMissing is set to a function. - throws an error if translation is not found and $.li18n.onTranslationMissing is not set.