Skip to content

Commit

Permalink
chore(all): prepare release 0.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 9, 2016
1 parent 466e6ae commit e97b702
Show file tree
Hide file tree
Showing 19 changed files with 438 additions and 364 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-i18n",
"version": "0.4.5",
"version": "0.4.6",
"description": "A plugin that provides i18n support.",
"keywords": [
"aurelia",
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/aurelia-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare module 'aurelia-i18n' {
/*eslint no-cond-assign: 0*/
export class I18N {
globalVars: any;
constructor(ea: any, loader: any, signaler: any);
constructor(ea: any, signaler: any);
setup(options?: any): any;
setLocale(locale: any): any;
getLocale(): any;
Expand Down
48 changes: 36 additions & 12 deletions dist/amd/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,16 @@ define(['exports', 'aurelia-event-aggregator', 'aurelia-templating', 'aurelia-lo

exports.__esModule = true;

function configure(frameworkConfig, cb) {
if (cb === undefined || typeof cb !== 'function') {
var errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

var instance = new _i18n.I18N(frameworkConfig.container.get(_aureliaEventAggregator.EventAggregator), frameworkConfig.container.get(_aureliaLoaderDefault.DefaultLoader), frameworkConfig.container.get(_aureliaTemplatingResources.BindingSignaler));
function registerI18N(frameworkConfig, cb) {
var instance = new _i18n.I18N(frameworkConfig.container.get(_aureliaEventAggregator.EventAggregator), frameworkConfig.container.get(_aureliaTemplatingResources.BindingSignaler));
frameworkConfig.container.registerInstance(_i18n.I18N, instance);

var ret = cb(instance);

frameworkConfig.postTask(function () {
var resources = frameworkConfig.container.get(_aureliaTemplating.ViewResources);
var htmlBehaviorResource = resources.getAttribute('t');
var htmlParamsResource = resources.getAttribute('t-params');
var attributes = instance.i18next.options.attributes;

if (!attributes) {
Expand All @@ -39,6 +30,39 @@ define(['exports', 'aurelia-event-aggregator', 'aurelia-templating', 'aurelia-lo
return ret;
}

function configure(frameworkConfig, cb) {
if (cb === undefined || typeof cb !== 'function') {
var errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

if (window.Intl === undefined) {
var _ret = (function () {
var loader = frameworkConfig.container.get(_aureliaLoaderDefault.DefaultLoader);

return {
v: loader.normalize('aurelia-i18n').then(function (i18nName) {
return loader.normalize('Intl.js', i18nName).then(function (intlName) {
return loader.loadModule(intlName).then(function (poly) {
window.Intl = poly;
return registerI18N(frameworkConfig, cb);
});
});
})
};
})();

if (typeof _ret === 'object') return _ret.v;
}

return Promise.resolve(registerI18N(frameworkConfig, cb));
}

exports.configure = configure;
exports.I18N = _i18n.I18N;
exports.RelativeTime = _relativeTime.RelativeTime;
Expand Down
11 changes: 1 addition & 10 deletions dist/amd/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define(['exports', 'i18next'], function (exports, _i18next) {
var _i18n = _interopRequireDefault(_i18next);

var I18N = (function () {
function I18N(ea, loader, signaler) {
function I18N(ea, signaler) {
_classCallCheck(this, I18N);

this.globalVars = {};
Expand All @@ -19,15 +19,6 @@ define(['exports', 'i18next'], function (exports, _i18next) {
this.ea = ea;
this.Intl = window.Intl;
this.signaler = signaler;

var i18nName = loader.normalizeSync('aurelia-i18n');
var intlName = loader.normalizeSync('Intl.js', i18nName);

if (window.Intl === undefined) {
loader.loadModule(intlName).then(function (poly) {
window.Intl = poly;
});
}
}

I18N.prototype.setup = function setup(options) {
Expand Down
2 changes: 1 addition & 1 deletion dist/aurelia-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare module 'aurelia-i18n' {
/*eslint no-cond-assign: 0*/
export class I18N {
globalVars: any;
constructor(ea: any, loader: any, signaler: any);
constructor(ea: any, signaler: any);
setup(options?: any): any;
setLocale(locale: any): any;
getLocale(): any;
Expand Down
56 changes: 32 additions & 24 deletions dist/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,11 @@ export class I18N {

globalVars = {};

constructor(ea, loader, signaler) {
constructor(ea, signaler) {
this.i18next = i18n;
this.ea = ea;
this.Intl = window.Intl;
this.signaler = signaler;

// check whether Intl is available, otherwise load the polyfill
let i18nName = loader.normalizeSync('aurelia-i18n');
let intlName = loader.normalizeSync('Intl.js', i18nName);

if (window.Intl === undefined) {
loader.loadModule(intlName).then( (poly) => {
window.Intl = poly;
});
}
}

setup(options?) {
Expand Down Expand Up @@ -682,26 +672,16 @@ export class RtValueConverter {
}
}

function configure(frameworkConfig, cb) {
if (cb === undefined || typeof cb !== 'function') {
let errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

let instance = new I18N(frameworkConfig.container.get(EventAggregator),
frameworkConfig.container.get(DefaultLoader), frameworkConfig.container.get(BindingSignaler));
function registerI18N(frameworkConfig, cb) {
let instance = new I18N(frameworkConfig.container.get(EventAggregator), frameworkConfig.container.get(BindingSignaler));
frameworkConfig.container.registerInstance(I18N, instance);

let ret = cb(instance);

frameworkConfig.postTask(() => {
let resources = frameworkConfig.container.get(ViewResources);
let htmlBehaviorResource = resources.getAttribute('t');
let htmlParamsResource = resources.getAttribute('t-params');
let attributes = instance.i18next.options.attributes;

// Register default attributes if none provided
Expand All @@ -716,6 +696,34 @@ function configure(frameworkConfig, cb) {
return ret;
}

function configure(frameworkConfig, cb): Promise<void> {
if (cb === undefined || typeof cb !== 'function') {
let errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

// check whether Intl is available, otherwise load the polyfill
if (window.Intl === undefined) {
let loader = frameworkConfig.container.get(DefaultLoader);

return loader.normalize('aurelia-i18n').then((i18nName) => {
return loader.normalize('Intl.js', i18nName).then((intlName) => {
return loader.loadModule(intlName).then((poly) => {
window.Intl = poly;
return registerI18N(frameworkConfig, cb);
});
});
});
}

return Promise.resolve(registerI18N(frameworkConfig, cb));
}

export {
configure,
I18N,
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/aurelia-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare module 'aurelia-i18n' {
/*eslint no-cond-assign: 0*/
export class I18N {
globalVars: any;
constructor(ea: any, loader: any, signaler: any);
constructor(ea: any, signaler: any);
setup(options?: any): any;
setLocale(locale: any): any;
getLocale(): any;
Expand Down
48 changes: 36 additions & 12 deletions dist/commonjs/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,16 @@ var _t = require('./t');

var _baseI18n = require('./base-i18n');

function configure(frameworkConfig, cb) {
if (cb === undefined || typeof cb !== 'function') {
var errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

var instance = new _i18n.I18N(frameworkConfig.container.get(_aureliaEventAggregator.EventAggregator), frameworkConfig.container.get(_aureliaLoaderDefault.DefaultLoader), frameworkConfig.container.get(_aureliaTemplatingResources.BindingSignaler));
function registerI18N(frameworkConfig, cb) {
var instance = new _i18n.I18N(frameworkConfig.container.get(_aureliaEventAggregator.EventAggregator), frameworkConfig.container.get(_aureliaTemplatingResources.BindingSignaler));
frameworkConfig.container.registerInstance(_i18n.I18N, instance);

var ret = cb(instance);

frameworkConfig.postTask(function () {
var resources = frameworkConfig.container.get(_aureliaTemplating.ViewResources);
var htmlBehaviorResource = resources.getAttribute('t');
var htmlParamsResource = resources.getAttribute('t-params');
var attributes = instance.i18next.options.attributes;

if (!attributes) {
Expand All @@ -60,6 +51,39 @@ function configure(frameworkConfig, cb) {
return ret;
}

function configure(frameworkConfig, cb) {
if (cb === undefined || typeof cb !== 'function') {
var errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

if (window.Intl === undefined) {
var _ret = (function () {
var loader = frameworkConfig.container.get(_aureliaLoaderDefault.DefaultLoader);

return {
v: loader.normalize('aurelia-i18n').then(function (i18nName) {
return loader.normalize('Intl.js', i18nName).then(function (intlName) {
return loader.loadModule(intlName).then(function (poly) {
window.Intl = poly;
return registerI18N(frameworkConfig, cb);
});
});
})
};
})();

if (typeof _ret === 'object') return _ret.v;
}

return Promise.resolve(registerI18N(frameworkConfig, cb));
}

exports.configure = configure;
exports.I18N = _i18n.I18N;
exports.RelativeTime = _relativeTime.RelativeTime;
Expand Down
11 changes: 1 addition & 10 deletions dist/commonjs/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var _i18next = require('i18next');
var _i18next2 = _interopRequireDefault(_i18next);

var I18N = (function () {
function I18N(ea, loader, signaler) {
function I18N(ea, signaler) {
_classCallCheck(this, I18N);

this.globalVars = {};
Expand All @@ -20,15 +20,6 @@ var I18N = (function () {
this.ea = ea;
this.Intl = window.Intl;
this.signaler = signaler;

var i18nName = loader.normalizeSync('aurelia-i18n');
var intlName = loader.normalizeSync('Intl.js', i18nName);

if (window.Intl === undefined) {
loader.loadModule(intlName).then(function (poly) {
window.Intl = poly;
});
}
}

I18N.prototype.setup = function setup(options) {
Expand Down
2 changes: 1 addition & 1 deletion dist/es6/aurelia-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare module 'aurelia-i18n' {
/*eslint no-cond-assign: 0*/
export class I18N {
globalVars: any;
constructor(ea: any, loader: any, signaler: any);
constructor(ea: any, signaler: any);
setup(options?: any): any;
setLocale(locale: any): any;
getLocale(): any;
Expand Down
44 changes: 31 additions & 13 deletions dist/es6/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,16 @@ import {TCustomAttribute} from './t';
import {TParamsCustomAttribute} from './t';
import {BaseI18N} from './base-i18n';

function configure(frameworkConfig, cb) {
if (cb === undefined || typeof cb !== 'function') {
let errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

let instance = new I18N(frameworkConfig.container.get(EventAggregator),
frameworkConfig.container.get(DefaultLoader), frameworkConfig.container.get(BindingSignaler));
function registerI18N(frameworkConfig, cb) {
let instance = new I18N(frameworkConfig.container.get(EventAggregator), frameworkConfig.container.get(BindingSignaler));
frameworkConfig.container.registerInstance(I18N, instance);

let ret = cb(instance);

frameworkConfig.postTask(() => {
let resources = frameworkConfig.container.get(ViewResources);
let htmlBehaviorResource = resources.getAttribute('t');
let htmlParamsResource = resources.getAttribute('t-params');
let attributes = instance.i18next.options.attributes;

// Register default attributes if none provided
Expand All @@ -48,6 +38,34 @@ function configure(frameworkConfig, cb) {
return ret;
}

function configure(frameworkConfig, cb): Promise<void> {
if (cb === undefined || typeof cb !== 'function') {
let errorMsg = 'You need to provide a callback method to properly configure the library';
throw errorMsg;
}

frameworkConfig.globalResources('./t');
frameworkConfig.globalResources('./nf');
frameworkConfig.globalResources('./df');
frameworkConfig.globalResources('./rt');

// check whether Intl is available, otherwise load the polyfill
if (window.Intl === undefined) {
let loader = frameworkConfig.container.get(DefaultLoader);

return loader.normalize('aurelia-i18n').then((i18nName) => {
return loader.normalize('Intl.js', i18nName).then((intlName) => {
return loader.loadModule(intlName).then((poly) => {
window.Intl = poly;
return registerI18N(frameworkConfig, cb);
});
});
});
}

return Promise.resolve(registerI18N(frameworkConfig, cb));
}

export {
configure,
I18N,
Expand Down
Loading

0 comments on commit e97b702

Please sign in to comment.