diff --git a/package.json b/package.json index 5a65ceab..a09ff8c0 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "karma-jspm": "^2.2.0", "merge2": "^1.0.2", "object.assign": "^4.0.4", - "require-dir": "^0.3.0", + "require-dir": "^0.3.2", "run-sequence": "^1.2.2", "through2": "^2.0.1", "typedoc": "^0.4.4", diff --git a/src/aurelia-i18n.js b/src/aurelia-i18n.js index 9fd2f1da..8b9f2b42 100644 --- a/src/aurelia-i18n.js +++ b/src/aurelia-i18n.js @@ -64,7 +64,7 @@ function configure(frameworkConfig, cb): Promise { frameworkConfig.globalResources(PLATFORM.moduleName('./rt')); // check whether Intl is available, otherwise load the polyfill - if (window.Intl === undefined) { + if (PLATFORM.global.Intl === undefined) { let i18nLogger = LogManager.getLogger('i18n'); i18nLogger.warn('Intl API is not available. Trying to load the polyfill.'); let loader = frameworkConfig.container.get(Loader); @@ -73,7 +73,7 @@ function configure(frameworkConfig, cb): Promise { return loader.normalize('aurelia-i18n').then((i18nName) => { return loader.normalize('intl', i18nName).then((intlName) => { return loader.loadModule(intlName).then((poly) => { - window.Intl = poly; + PLATFORM.global.Intl = poly; return registerI18N(frameworkConfig, cb); }, () => i18nLogger.warn('Failed to load the Intl polyfill.')); }, () => i18nLogger.warn(normalizeErrorMessage.replace('{module}', 'intl'))); diff --git a/src/base-i18n.js b/src/base-i18n.js index debd711f..7c48580e 100644 --- a/src/base-i18n.js +++ b/src/base-i18n.js @@ -1,9 +1,10 @@ import {I18N} from './i18n'; +import {DOM} from 'aurelia-pal'; import {EventAggregator} from 'aurelia-event-aggregator'; export class BaseI18N { - static inject = [I18N, Element, EventAggregator]; + static inject = [I18N, DOM.Element, EventAggregator]; constructor(i18n, element, ea) { this.i18n = i18n; diff --git a/src/i18n.js b/src/i18n.js index 76510040..0041aa09 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -1,7 +1,7 @@ /*eslint no-cond-assign: 0*/ import * as LogManager from 'aurelia-logging'; import i18next from 'i18next'; -import {DOM} from 'aurelia-pal'; +import {DOM, PLATFORM} from 'aurelia-pal'; import {EventAggregator} from 'aurelia-event-aggregator'; import {BindingSignaler} from 'aurelia-templating-resources'; @@ -20,7 +20,7 @@ export class I18N { constructor(ea, signaler) { this.i18next = i18next; this.ea = ea; - this.Intl = window.Intl; + this.Intl = PLATFORM.global.Intl; this.signaler = signaler; this.i18nextDefered.promise = new Promise((resolve) => this.i18nextDefered.resolve = resolve); } diff --git a/src/t.js b/src/t.js index dd3fcea9..03c294cb 100644 --- a/src/t.js +++ b/src/t.js @@ -4,6 +4,7 @@ import {metadata} from 'aurelia-metadata'; import {customAttribute, HtmlBehaviorResource} from 'aurelia-templating'; import {SignalBindingBehavior} from 'aurelia-templating-resources'; import {ValueConverter} from 'aurelia-binding'; +import {DOM} from 'aurelia-pal'; import {LazyOptional} from './utils'; @@ -20,7 +21,7 @@ export class TValueConverter { @customAttribute('t-params') export class TParamsCustomAttribute { - static inject = [Element]; + static inject = [DOM.Element]; static configureAliases(aliases) { let r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute); r.aliases = aliases; @@ -39,7 +40,7 @@ export class TParamsCustomAttribute { @customAttribute('t') export class TCustomAttribute { - static inject = [Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; + static inject = [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; static configureAliases(aliases) { let r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute); r.aliases = aliases;