UNPKG

@mongez/localization

Version:

A simple i18n localization handler for browsers and nodejs

10 lines (9 loc) 498 B
import events from'@mongez/events';const BASE_LOCALIZATION_CHANGE_EVENT = "localization.change"; const localizationEvents = { triggerChange(eventName, newLocaleCode, oldLocaleCode) { events.trigger(BASE_LOCALIZATION_CHANGE_EVENT + "." + eventName, newLocaleCode, oldLocaleCode); }, onChange(eventName, callback) { return events.subscribe(BASE_LOCALIZATION_CHANGE_EVENT + "." + eventName, callback); }, };export{localizationEvents};//# sourceMappingURL=events.js.map