UNPKG

coveo-search-ui-extensions

Version:

Small generic components to extend the functionality of Coveo's Search UI framework.

27 lines 897 B
/** * Supported languages. */ export var Language; (function (Language) { Language["English"] = "en"; })(Language || (Language = {})); /** * Translation utilities. */ export class Translation { /** * Register translations for a language. * * @param language Language of the dictionary. * @param translationDictionary Key-Value dictionary that contain all traslation for a language. */ static register(language, translationDictionary) { Object.keys(translationDictionary).forEach((key) => { String['locales'] = String['locales'] || {}; String['locales'][language] = String['locales'][language] || {}; String['locales'][language][key] = translationDictionary[key]; }); String['toLocaleString'].call(this, { [language]: String['locales'][language] }); } } //# sourceMappingURL=translation.js.map