Skip to content

Commit

Permalink
2.0.0-rc.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chemerisuk committed May 15, 2016
1 parent b5f7e56 commit 69488d2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "better-i18n-plugin",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"main": [
"dist/better-i18n-plugin.js"
],
Expand Down
21 changes: 13 additions & 8 deletions dist/better-i18n-plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* better-i18n-plugin: Internationalization plugin for better-dom
* @version 2.0.0-rc.1 Mon, 11 Apr 2016 10:16:21 GMT
* @link https://github.com/chemerisuk/better-emmet-plugin
* @version 2.0.0-rc.2 Sun, 15 May 2016 11:43:41 GMT
* @link https://github.com/chemerisuk/better-i18n-plugin
* @copyright 2016 Maksim Chemerisuk
* @license MIT
*/
Expand All @@ -12,14 +12,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons

var strings = [],
languages = [],
reParam = /%s/g,
HTML = DOM.get("documentElement");

function formatKey(key, args) {
var start = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];

return key.replace(/%s/g, function (str) {
return args[start++] || str;
});
if (args) {
return key.replace(reParam, function (str) {
return args[start++] || str;
});
} else {
return key;
}
}

var Entry = function () {
Expand All @@ -32,11 +37,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var value = strings[index][key];

if (value) {
_this[lang] = args ? formatKey(value, args) : value;
_this[lang] = formatKey(value, args);
}
});

this._ = args ? formatKey(key, args) : key;
this._ = formatKey(key, args);
}

Entry.prototype.toString = function toString() {
Expand Down Expand Up @@ -106,7 +111,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
};

DOM.__.esliteral = function (parts) {
DOM.i18nLiteral = function (parts) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
Expand Down
6 changes: 3 additions & 3 deletions dist/better-i18n-plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "better-i18n-plugin",
"description": "Internationalization plugin for better-dom",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"author": "Maksim Chemerisuk",
"license": "MIT",
"homepage": "https://github.com/chemerisuk/better-i18n-plugin",
Expand Down

0 comments on commit 69488d2

Please sign in to comment.