Skip to content

Commit

Permalink
chore(all): prepare release 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Apr 10, 2017
1 parent aef8d1a commit c3b7fe4
Show file tree
Hide file tree
Showing 22 changed files with 306 additions and 39 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": "1.4.0",
"version": "1.5.0",
"description": "A plugin that provides i18n support.",
"keywords": [
"aurelia",
Expand Down
5 changes: 4 additions & 1 deletion dist/amd/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(['exports', 'aurelia-logging', 'aurelia-event-aggregator', 'aurelia-templ
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Backend = exports.EventAggregator = exports.BaseI18N = exports.TParamsCustomAttribute = exports.TCustomAttribute = exports.TBindingBehavior = exports.TValueConverter = exports.RtValueConverter = exports.NfValueConverter = exports.DfValueConverter = exports.RelativeTime = exports.I18N = exports.configure = undefined;
exports.Backend = exports.EventAggregator = exports.BaseI18N = exports.TParamsCustomAttribute = exports.TCustomAttribute = exports.TBindingBehavior = exports.TValueConverter = exports.RtBindingBehavior = exports.RtValueConverter = exports.NfBindingBehavior = exports.NfValueConverter = exports.DfBindingBehavior = exports.DfValueConverter = exports.RelativeTime = exports.I18N = exports.configure = undefined;

var LogManager = _interopRequireWildcard(_aureliaLogging);

Expand Down Expand Up @@ -104,8 +104,11 @@ define(['exports', 'aurelia-logging', 'aurelia-event-aggregator', 'aurelia-templ
exports.I18N = _i18n.I18N;
exports.RelativeTime = _relativeTime.RelativeTime;
exports.DfValueConverter = _df.DfValueConverter;
exports.DfBindingBehavior = _df.DfBindingBehavior;
exports.NfValueConverter = _nf.NfValueConverter;
exports.NfBindingBehavior = _nf.NfBindingBehavior;
exports.RtValueConverter = _rt.RtValueConverter;
exports.RtBindingBehavior = _rt.RtBindingBehavior;
exports.TValueConverter = _t.TValueConverter;
exports.TBindingBehavior = _t.TBindingBehavior;
exports.TCustomAttribute = _t.TCustomAttribute;
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/relativeTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ define(['exports', './i18n', './defaultTranslations/relative.time', 'aurelia-eve

if (options.interpolation && options.interpolation.prefix !== '__' || options.interpolation.suffix !== '__') {
for (var subkey in translation) {
translation[subkey] = translation[subkey].replace('__count__', options.interpolation.prefix + 'count' + options.interpolation.suffix);
translation[subkey] = translation[subkey].replace('__count__', (options.interpolation.prefix || '{{') + 'count' + (options.interpolation.suffix || '}}'));
}
}

Expand Down
36 changes: 34 additions & 2 deletions dist/amd/rt.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
define(['exports', './relativeTime'], function (exports, _relativeTime) {
define(['exports', './relativeTime', 'aurelia-templating-resources', 'aurelia-binding'], function (exports, _relativeTime, _aureliaTemplatingResources, _aureliaBinding) {
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RtValueConverter = undefined;
exports.RtBindingBehavior = exports.RtValueConverter = undefined;



Expand Down Expand Up @@ -33,4 +33,36 @@ define(['exports', './relativeTime'], function (exports, _relativeTime) {

return RtValueConverter;
}();

var RtBindingBehavior = exports.RtBindingBehavior = function () {
RtBindingBehavior.inject = function inject() {
return [_aureliaTemplatingResources.SignalBindingBehavior];
};

function RtBindingBehavior(signalBindingBehavior) {


this.signalBindingBehavior = signalBindingBehavior;
}

RtBindingBehavior.prototype.bind = function bind(binding, source) {
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');

var sourceExpression = binding.sourceExpression;

if (sourceExpression.rewritten) {
return;
}
sourceExpression.rewritten = true;

var expression = sourceExpression.expression;
sourceExpression.expression = new _aureliaBinding.ValueConverter(expression, 'rt', sourceExpression.args, [expression].concat(sourceExpression.args));
};

RtBindingBehavior.prototype.unbind = function unbind(binding, source) {
this.signalBindingBehavior.unbind(binding, source);
};

return RtBindingBehavior;
}();
});
6 changes: 6 additions & 0 deletions dist/aurelia-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,10 @@ export declare class RtValueConverter {
static inject(): any;
constructor(relativeTime?: any);
toView(value?: any): any;
}
export declare class RtBindingBehavior {
static inject(): any;
constructor(signalBindingBehavior?: any);
bind(binding?: any, source?: any): any;
unbind(binding?: any, source?: any): any;
}
45 changes: 40 additions & 5 deletions dist/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,8 @@ export class DfBindingBehavior {
// bind the signal behavior
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');

// rewrite the expression to use the TValueConverter.
// pass through any args to the binding behavior to the TValueConverter
// rewrite the expression to use the DfValueConverter.
// pass through any args to the binding behavior to the DfValueConverter
let sourceExpression = binding.sourceExpression;

// do create the sourceExpression only once
Expand Down Expand Up @@ -941,8 +941,8 @@ export class NfBindingBehavior {
// bind the signal behavior
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');

// rewrite the expression to use the TValueConverter.
// pass through any args to the binding behavior to the TValueConverter
// rewrite the expression to use the NfValueConverter.
// pass through any args to the binding behavior to the NfValueConverter
let sourceExpression = binding.sourceExpression;

// do create the sourceExpression only once
Expand Down Expand Up @@ -1006,7 +1006,7 @@ export class RelativeTime {

if (options.interpolation && options.interpolation.prefix !== '__' || options.interpolation.suffix !== '__') {
for (let subkey in translation) {
translation[subkey] = translation[subkey].replace('__count__', options.interpolation.prefix + 'count' + options.interpolation.suffix);
translation[subkey] = translation[subkey].replace('__count__', `${options.interpolation.prefix || '{{'}count${options.interpolation.suffix || '}}'}`);
}
}

Expand Down Expand Up @@ -1188,3 +1188,38 @@ export class RtValueConverter {
return this.service.getRelativeTime(value);
}
}

export class RtBindingBehavior {
static inject() {return [SignalBindingBehavior];}

constructor(signalBindingBehavior) {
this.signalBindingBehavior = signalBindingBehavior;
}

bind(binding, source) {
// bind the signal behavior
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');

// rewrite the expression to use the RtValueConverter.
// pass through any args to the binding behavior to the RtValueConverter
let sourceExpression = binding.sourceExpression;

// do create the sourceExpression only once
if (sourceExpression.rewritten) {
return;
}
sourceExpression.rewritten = true;

let expression = sourceExpression.expression;
sourceExpression.expression = new ValueConverter(
expression,
'rt',
sourceExpression.args,
[expression, ...sourceExpression.args]);
}

unbind(binding, source) {
// unbind the signal behavior
this.signalBindingBehavior.unbind(binding, source);
}
}
5 changes: 4 additions & 1 deletion dist/commonjs/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Backend = exports.EventAggregator = exports.BaseI18N = exports.TParamsCustomAttribute = exports.TCustomAttribute = exports.TBindingBehavior = exports.TValueConverter = exports.RtValueConverter = exports.NfValueConverter = exports.DfValueConverter = exports.RelativeTime = exports.I18N = exports.configure = undefined;
exports.Backend = exports.EventAggregator = exports.BaseI18N = exports.TParamsCustomAttribute = exports.TCustomAttribute = exports.TBindingBehavior = exports.TValueConverter = exports.RtBindingBehavior = exports.RtValueConverter = exports.NfBindingBehavior = exports.NfValueConverter = exports.DfBindingBehavior = exports.DfValueConverter = exports.RelativeTime = exports.I18N = exports.configure = undefined;

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };

Expand Down Expand Up @@ -112,8 +112,11 @@ exports.configure = configure;
exports.I18N = _i18n.I18N;
exports.RelativeTime = _relativeTime.RelativeTime;
exports.DfValueConverter = _df.DfValueConverter;
exports.DfBindingBehavior = _df.DfBindingBehavior;
exports.NfValueConverter = _nf.NfValueConverter;
exports.NfBindingBehavior = _nf.NfBindingBehavior;
exports.RtValueConverter = _rt.RtValueConverter;
exports.RtBindingBehavior = _rt.RtBindingBehavior;
exports.TValueConverter = _t.TValueConverter;
exports.TBindingBehavior = _t.TBindingBehavior;
exports.TCustomAttribute = _t.TCustomAttribute;
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/relativeTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var RelativeTime = exports.RelativeTime = function () {

if (options.interpolation && options.interpolation.prefix !== '__' || options.interpolation.suffix !== '__') {
for (var subkey in translation) {
translation[subkey] = translation[subkey].replace('__count__', options.interpolation.prefix + 'count' + options.interpolation.suffix);
translation[subkey] = translation[subkey].replace('__count__', (options.interpolation.prefix || '{{') + 'count' + (options.interpolation.suffix || '}}'));
}
}

Expand Down
38 changes: 37 additions & 1 deletion dist/commonjs/rt.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RtValueConverter = undefined;
exports.RtBindingBehavior = exports.RtValueConverter = undefined;

var _relativeTime = require('./relativeTime');

var _aureliaTemplatingResources = require('aurelia-templating-resources');

var _aureliaBinding = require('aurelia-binding');



var RtValueConverter = exports.RtValueConverter = function () {
Expand All @@ -33,4 +37,36 @@ var RtValueConverter = exports.RtValueConverter = function () {
};

return RtValueConverter;
}();

var RtBindingBehavior = exports.RtBindingBehavior = function () {
RtBindingBehavior.inject = function inject() {
return [_aureliaTemplatingResources.SignalBindingBehavior];
};

function RtBindingBehavior(signalBindingBehavior) {


this.signalBindingBehavior = signalBindingBehavior;
}

RtBindingBehavior.prototype.bind = function bind(binding, source) {
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');

var sourceExpression = binding.sourceExpression;

if (sourceExpression.rewritten) {
return;
}
sourceExpression.rewritten = true;

var expression = sourceExpression.expression;
sourceExpression.expression = new _aureliaBinding.ValueConverter(expression, 'rt', sourceExpression.args, [expression].concat(sourceExpression.args));
};

RtBindingBehavior.prototype.unbind = function unbind(binding, source) {
this.signalBindingBehavior.unbind(binding, source);
};

return RtBindingBehavior;
}();
13 changes: 5 additions & 8 deletions dist/es2015/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ import { PLATFORM } from 'aurelia-pal';

import { I18N } from './i18n';
import { RelativeTime } from './relativeTime';
import { DfValueConverter } from './df';
import { NfValueConverter } from './nf';
import { RtValueConverter } from './rt';
import { TValueConverter } from './t';
import { TBindingBehavior } from './t';
import { TCustomAttribute } from './t';
import { TParamsCustomAttribute } from './t';
import { DfValueConverter, DfBindingBehavior } from './df';
import { NfValueConverter, NfBindingBehavior } from './nf';
import { RtValueConverter, RtBindingBehavior } from './rt';
import { TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute } from './t';
import { BaseI18N } from './base-i18n';
import { Backend } from './aurelia-i18n-loader';

Expand Down Expand Up @@ -70,4 +67,4 @@ function configure(frameworkConfig, cb) {
return Promise.resolve(registerI18N(frameworkConfig, cb));
}

export { configure, I18N, RelativeTime, DfValueConverter, NfValueConverter, RtValueConverter, TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute, BaseI18N, EventAggregator, Backend };
export { configure, I18N, RelativeTime, DfValueConverter, DfBindingBehavior, NfValueConverter, NfBindingBehavior, RtValueConverter, RtBindingBehavior, TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute, BaseI18N, EventAggregator, Backend };
2 changes: 1 addition & 1 deletion dist/es2015/relativeTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export let RelativeTime = class RelativeTime {

if (options.interpolation && options.interpolation.prefix !== '__' || options.interpolation.suffix !== '__') {
for (let subkey in translation) {
translation[subkey] = translation[subkey].replace('__count__', options.interpolation.prefix + 'count' + options.interpolation.suffix);
translation[subkey] = translation[subkey].replace('__count__', `${ options.interpolation.prefix || '{{' }count${ options.interpolation.suffix || '}}' }`);
}
}

Expand Down
30 changes: 30 additions & 0 deletions dist/es2015/rt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { RelativeTime } from './relativeTime';
import { SignalBindingBehavior } from 'aurelia-templating-resources';
import { ValueConverter } from 'aurelia-binding';

export let RtValueConverter = class RtValueConverter {
static inject() {
Expand All @@ -19,4 +21,32 @@ export let RtValueConverter = class RtValueConverter {

return this.service.getRelativeTime(value);
}
};

export let RtBindingBehavior = class RtBindingBehavior {
static inject() {
return [SignalBindingBehavior];
}

constructor(signalBindingBehavior) {
this.signalBindingBehavior = signalBindingBehavior;
}

bind(binding, source) {
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');

let sourceExpression = binding.sourceExpression;

if (sourceExpression.rewritten) {
return;
}
sourceExpression.rewritten = true;

let expression = sourceExpression.expression;
sourceExpression.expression = new ValueConverter(expression, 'rt', sourceExpression.args, [expression, ...sourceExpression.args]);
}

unbind(binding, source) {
this.signalBindingBehavior.unbind(binding, source);
}
};
13 changes: 5 additions & 8 deletions dist/native-modules/aurelia-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ import { PLATFORM } from 'aurelia-pal';

import { I18N } from './i18n';
import { RelativeTime } from './relativeTime';
import { DfValueConverter } from './df';
import { NfValueConverter } from './nf';
import { RtValueConverter } from './rt';
import { TValueConverter } from './t';
import { TBindingBehavior } from './t';
import { TCustomAttribute } from './t';
import { TParamsCustomAttribute } from './t';
import { DfValueConverter, DfBindingBehavior } from './df';
import { NfValueConverter, NfBindingBehavior } from './nf';
import { RtValueConverter, RtBindingBehavior } from './rt';
import { TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute } from './t';
import { BaseI18N } from './base-i18n';
import { Backend } from './aurelia-i18n-loader';

Expand Down Expand Up @@ -88,4 +85,4 @@ function configure(frameworkConfig, cb) {
return Promise.resolve(registerI18N(frameworkConfig, cb));
}

export { configure, I18N, RelativeTime, DfValueConverter, NfValueConverter, RtValueConverter, TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute, BaseI18N, EventAggregator, Backend };
export { configure, I18N, RelativeTime, DfValueConverter, DfBindingBehavior, NfValueConverter, NfBindingBehavior, RtValueConverter, RtBindingBehavior, TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute, BaseI18N, EventAggregator, Backend };
2 changes: 1 addition & 1 deletion dist/native-modules/relativeTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export var RelativeTime = function () {

if (options.interpolation && options.interpolation.prefix !== '__' || options.interpolation.suffix !== '__') {
for (var subkey in translation) {
translation[subkey] = translation[subkey].replace('__count__', options.interpolation.prefix + 'count' + options.interpolation.suffix);
translation[subkey] = translation[subkey].replace('__count__', (options.interpolation.prefix || '{{') + 'count' + (options.interpolation.suffix || '}}'));
}
}

Expand Down
Loading

0 comments on commit c3b7fe4

Please sign in to comment.