I18N.js 389 B

123456789101112131415161718
  1. /**
  2. * A component that handles language switching in a unified way.
  3. *
  4. * @param {EventBus} eventBus
  5. */
  6. export default function I18N(eventBus) {
  7. /**
  8. * Inform components that the language changed.
  9. *
  10. * Emit a `i18n.changed` event for others to hook into, too.
  11. */
  12. this.changed = function changed() {
  13. eventBus.fire('i18n.changed');
  14. };
  15. }
  16. I18N.$inject = [ 'eventBus' ];