diff --git a/bower.json b/bower.json index 134530d8..4c877ecb 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-i18n", - "version": "0.2.1", + "version": "0.2.2", "description": "A plugin that provides i18n support.", "keywords": [ "aurelia", diff --git a/dist/amd/index.js b/dist/amd/index.js index 6c14a7f3..92f487f0 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -84,8 +84,13 @@ define(['exports', './i18n', 'aurelia-event-aggregator', 'aurelia-templating', ' frameworkConfig.postTask(function () { var resources = frameworkConfig.container.get(_aureliaTemplating.ViewResources); var htmlBehaviorResource = resources.getAttribute('t'); + var attributes = instance.i18next.options.attributes; - instance.i18next.options.attributes.forEach(function (alias) { + if (!attributes) { + attributes = ['t', 'i18n']; + } + + attributes.forEach(function (alias) { return resources.registerAttribute(alias, htmlBehaviorResource, 't'); }); }); diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 0e4875bd..0937ef4e 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -108,8 +108,13 @@ function configure(frameworkConfig, cb) { frameworkConfig.postTask(function () { var resources = frameworkConfig.container.get(_aureliaTemplating.ViewResources); var htmlBehaviorResource = resources.getAttribute('t'); + var attributes = instance.i18next.options.attributes; - instance.i18next.options.attributes.forEach(function (alias) { + if (!attributes) { + attributes = ['t', 'i18n']; + } + + attributes.forEach(function (alias) { return resources.registerAttribute(alias, htmlBehaviorResource, 't'); }); }); diff --git a/dist/es6/index.js b/dist/es6/index.js index 176de33b..6348072a 100644 --- a/dist/es6/index.js +++ b/dist/es6/index.js @@ -31,8 +31,14 @@ export function configure(frameworkConfig, cb) { frameworkConfig.postTask(() => { let resources = frameworkConfig.container.get(ViewResources); let htmlBehaviorResource = resources.getAttribute('t'); + let attributes = instance.i18next.options.attributes; - instance.i18next.options.attributes.forEach(alias => resources.registerAttribute(alias, htmlBehaviorResource, 't')); + // Register default attributes if none provided + if (!attributes) { + attributes = ['t', 'i18n']; + } + + attributes.forEach(alias => resources.registerAttribute(alias, htmlBehaviorResource, 't')); }); return ret; diff --git a/dist/system/index.js b/dist/system/index.js index 27102e56..eff30b32 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -23,8 +23,13 @@ System.register(['./i18n', 'aurelia-event-aggregator', 'aurelia-templating', './ frameworkConfig.postTask(function () { var resources = frameworkConfig.container.get(ViewResources); var htmlBehaviorResource = resources.getAttribute('t'); + var attributes = instance.i18next.options.attributes; - instance.i18next.options.attributes.forEach(function (alias) { + if (!attributes) { + attributes = ['t', 'i18n']; + } + + attributes.forEach(function (alias) { return resources.registerAttribute(alias, htmlBehaviorResource, 't'); }); }); diff --git a/package.json b/package.json index d79f840b..df209a52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-i18n", - "version": "0.2.1", + "version": "0.2.2", "description": "A plugin that provides i18n support.", "keywords": [ "aurelia", diff --git a/src/index.js b/src/index.js index 176de33b..6348072a 100644 --- a/src/index.js +++ b/src/index.js @@ -31,8 +31,14 @@ export function configure(frameworkConfig, cb) { frameworkConfig.postTask(() => { let resources = frameworkConfig.container.get(ViewResources); let htmlBehaviorResource = resources.getAttribute('t'); + let attributes = instance.i18next.options.attributes; - instance.i18next.options.attributes.forEach(alias => resources.registerAttribute(alias, htmlBehaviorResource, 't')); + // Register default attributes if none provided + if (!attributes) { + attributes = ['t', 'i18n']; + } + + attributes.forEach(alias => resources.registerAttribute(alias, htmlBehaviorResource, 't')); }); return ret;