Skip to content

Commit

Permalink
dist rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Puzrin committed Nov 29, 2021
1 parent 2fb9fd1 commit 4322695
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 35 deletions.
153 changes: 119 additions & 34 deletions dist/babelfish.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,8 @@ module.exports = (function() {
*
* Autogenerated from CLDR:
*
* Version: 36
* Unicode version: 12.1.0
* Version: 40
* Unicode version: 14.0.0
*/

'use strict';
Expand All @@ -943,6 +943,8 @@ function forms(loc) {
return s[l] ? s[l].c : null;
}

var c_re = /c\d+$/;

function indexOf(loc, value) {
var l = normalize(loc);
if (!l) {
Expand All @@ -953,14 +955,24 @@ function indexOf(loc, value) {
return 0;
}

var sval = String(value),
f = sval.indexOf('.') < 0 ? '' : sval.split('.')[1],
v = f.length,
n = +value,
i = +(sval.split('.')[0]),
t = f.length === 0 ? 0 : +f.replace(/0+$/, '');
var sval = String(value);
var e = 0;

if (c_re.test(sval)) {
var spl = sval.split('c');
e = +spl[1];
value = Math.pow(10, e) * spl[0];
sval = String(value);
}

var f = sval.indexOf('.') < 0 ? '' : sval.split('.')[1];
var v = f.length;
var w = f.replace(/0+$/, '').length;
var n = +value;
var i = +(sval.split('.')[0]);
var t = f.length === 0 ? 0 : +f.replace(/0+$/, '');

return s[l].cFn(n, i, v, +f, t);
return s[l].cFn(n, i, v, +f, t, w, e);
}

function plural(loc, value) {
Expand All @@ -987,14 +999,24 @@ function o_indexOf(loc, value) {
return 0;
}

var sval = String(value),
f = sval.indexOf('.') < 0 ? '' : sval.split('.')[1],
v = f.length,
n = +value,
i = +(sval.split('.')[0]),
t = f.length === 0 ? 0 : +f.replace(/0+$/, '');
var sval = String(value);
var e = 0;

return s[l].oFn(n, i, v, +f, t);
if (c_re.test(sval)) {
var spl = sval.split('c');
e = +spl[1];
value = Math.pow(10, e) * spl[0];
sval = String(value);
}

var f = sval.indexOf('.') < 0 ? '' : sval.split('.')[1];
var v = f.length;
var w = f.replace(/0+$/, '').length;
var n = +value;
var i = +(sval.split('.')[0]);
var t = f.length === 0 ? 0 : +f.replace(/0+$/, '');

return s[l].oFn(n, i, v, +f, t, w, e);
}

function ordinal(loc, value) {
Expand Down Expand Up @@ -1035,7 +1057,7 @@ function B(x, y, val) { return x <= val && val <= y && val % 1 === 0; }
function IN(set, val) { return set.indexOf(val) >= 0; }


add([ 'af', 'an', 'asa', 'bem', 'bez', 'bg', 'brx', 'ce', 'cgg', 'chr', 'ckb', 'dv', 'ee', 'el', 'eo', 'es', 'eu', 'fo', 'fur', 'gsw', 'ha', 'haw', 'jgo', 'jmc', 'kaj', 'kcg', 'kkj', 'kl', 'ks', 'ksb', 'ku', 'ky', 'lb', 'lg', 'mas', 'mgo', 'ml', 'mn', 'nah', 'nb', 'nd', 'nn', 'nnh', 'no', 'nr', 'ny', 'nyn', 'om', 'os', 'pap', 'ps', 'rm', 'rof', 'rwk', 'saq', 'sd', 'sdh', 'seh', 'sn', 'so', 'ss', 'ssy', 'st', 'syr', 'ta', 'te', 'teo', 'tig', 'tn', 'tr', 'ts', 'ug', 'uz', 've', 'vo', 'vun', 'wae', 'xh', 'xog' ], {
add([ 'af', 'an', 'asa', 'bem', 'bez', 'bg', 'brx', 'ce', 'cgg', 'chr', 'ckb', 'dv', 'ee', 'el', 'eo', 'eu', 'fo', 'fur', 'gsw', 'ha', 'haw', 'jgo', 'jmc', 'kaj', 'kcg', 'kkj', 'kl', 'ks', 'ksb', 'ku', 'ky', 'lb', 'lg', 'mas', 'mgo', 'ml', 'mn', 'nah', 'nb', 'nd', 'nn', 'nnh', 'no', 'nr', 'ny', 'nyn', 'om', 'os', 'pap', 'ps', 'rm', 'rof', 'rwk', 'saq', 'sd', 'sdh', 'seh', 'sn', 'so', 'ss', 'ssy', 'st', 'syr', 'ta', 'te', 'teo', 'tig', 'tn', 'tr', 'ts', 'ug', 'uz', 've', 'vo', 'vun', 'wae', 'xh', 'xog' ], {
c: [ 1, 5 ],
cFn: function (n) {
return n === 1 ? 0 : 1;
Expand All @@ -1049,7 +1071,7 @@ add([ 'ak', 'bho', 'guw', 'ln', 'mg', 'nso', 'pa', 'ti', 'wa' ], {
}
});

add([ 'am', 'fa', 'kn', 'zu' ], {
add([ 'am', 'doi', 'fa', 'kn', 'pcm', 'zu' ], {
c: [ 1, 5 ],
cFn: function (n, i) {
return i === 0 || n === 1 ? 0 : 1;
Expand All @@ -1075,7 +1097,7 @@ add([ 'as', 'bn' ], {
}
});

add([ 'ast', 'de', 'et', 'fi', 'fy', 'gl', 'ia', 'io', 'ji', 'nl', 'pt-pt', 'sw', 'ur', 'yi' ], {
add([ 'ast', 'de', 'et', 'fi', 'fy', 'gl', 'ia', 'io', 'nl', 'sw', 'ur', 'yi' ], {
c: [ 1, 5 ],
cFn: function (n, i, v) {
return i === 1 && v === 0 ? 0 : 1;
Expand All @@ -1094,6 +1116,17 @@ add([ 'az' ], {
}
});

add([ 'bal' ], {
c: [ 1, 5 ],
cFn: function (n) {
return n === 1 ? 0 : 1;
},
o: [ 1, 5 ],
oFn: function (n) {
return n === 1 ? 0 : 1;
}
});

add([ 'be' ], {
c: [ 1, 3, 4, 5 ],
cFn: function (n) {
Expand All @@ -1107,7 +1140,7 @@ add([ 'be' ], {
}
});

add([ 'bm', 'bo', 'dz', 'id', 'ig', 'ii', 'in', 'ja', 'jbo', 'jv', 'jw', 'kde', 'kea', 'km', 'ko', 'lkt', 'my', 'nqo', 'osa', 'root', 'sah', 'ses', 'sg', 'su', 'th', 'to', 'wo', 'yo', 'yue', 'zh' ], {
add([ 'bm', 'bo', 'dz', 'hnj', 'id', 'ig', 'ii', 'ja', 'jbo', 'jv', 'jw', 'kde', 'kea', 'km', 'ko', 'lkt', 'my', 'nqo', 'osa', 'sah', 'ses', 'sg', 'su', 'th', 'to', 'tpi', 'und', 'wo', 'yo', 'yue', 'zh' ], {
});

add([ 'br' ], {
Expand Down Expand Up @@ -1190,6 +1223,14 @@ add([ 'en' ], {
}
});

add([ 'es' ], {
c: [ 1, 4, 5 ],
cFn: function (n, i, v, f, t, w, e) {
var i1000000 = i % 1000000;
return n === 1 ? 0 : e === 0 && i !== 0 && i1000000 === 0 && v === 0 || !B(0, 5, e) ? 1 : 2;
}
});

add([ 'ff', 'kab' ], {
c: [ 1, 5 ],
cFn: function (n, i) {
Expand All @@ -1209,10 +1250,11 @@ add([ 'fil', 'tl' ], {
}
});

add([ 'fr', 'hy' ], {
c: [ 1, 5 ],
cFn: function (n, i) {
return IN([ 0, 1 ], i) ? 0 : 1;
add([ 'fr' ], {
c: [ 1, 4, 5 ],
cFn: function (n, i, v, f, t, w, e) {
var i1000000 = i % 1000000;
return IN([ 0, 1 ], i) ? 0 : e === 0 && i !== 0 && i1000000 === 0 && v === 0 || !B(0, 5, e) ? 1 : 2;
},
o: [ 1, 5 ],
oFn: function (n) {
Expand Down Expand Up @@ -1261,7 +1303,7 @@ add([ 'gv' ], {
}
});

add([ 'he', 'iw' ], {
add([ 'he' ], {
c: [ 1, 2, 4, 5 ],
cFn: function (n, i, v) {
var n10 = n % 10;
Expand All @@ -1280,6 +1322,17 @@ add([ 'hu' ], {
}
});

add([ 'hy' ], {
c: [ 1, 5 ],
cFn: function (n, i) {
return IN([ 0, 1 ], i) ? 0 : 1;
},
o: [ 1, 5 ],
oFn: function (n) {
return n === 1 ? 0 : 1;
}
});

add([ 'is' ], {
c: [ 1, 5 ],
cFn: function (n, i, v, f, t) {
Expand All @@ -1288,18 +1341,19 @@ add([ 'is' ], {
}
});

add([ 'it', 'sc', 'scn' ], {
c: [ 1, 5 ],
cFn: function (n, i, v) {
return i === 1 && v === 0 ? 0 : 1;
add([ 'it' ], {
c: [ 1, 4, 5 ],
cFn: function (n, i, v, f, t, w, e) {
var i1000000 = i % 1000000;
return i === 1 && v === 0 ? 0 : e === 0 && i !== 0 && i1000000 === 0 && v === 0 || !B(0, 5, e) ? 1 : 2;
},
o: [ 4, 5 ],
oFn: function (n) {
return IN([ 11, 8, 80, 800 ], n) ? 0 : 1;
}
});

add([ 'iu', 'naq', 'se', 'sma', 'smi', 'smj', 'smn', 'sms' ], {
add([ 'iu', 'naq', 'sat', 'se', 'sma', 'smi', 'smj', 'smn', 'sms' ], {
c: [ 1, 2, 5 ],
cFn: function (n) {
return n === 1 ? 0 : n === 2 ? 1 : 2;
Expand Down Expand Up @@ -1357,6 +1411,17 @@ add([ 'lag' ], {
}
});

add([ 'lij' ], {
c: [ 1, 5 ],
cFn: function (n, i, v) {
return i === 1 && v === 0 ? 0 : 1;
},
o: [ 4, 5 ],
oFn: function (n) {
return (n === 11 || n === 8 || B(80, 89, n) || B(800, 899, n)) ? 0 : 1;
}
});

add([ 'lo', 'ms', 'vi' ], {
o: [ 1, 5 ],
oFn: function (n) {
Expand Down Expand Up @@ -1455,9 +1520,18 @@ add([ 'pl' ], {
});

add([ 'pt' ], {
c: [ 1, 5 ],
cFn: function (n, i) {
return B(0, 1, i) ? 0 : 1;
c: [ 1, 4, 5 ],
cFn: function (n, i, v, f, t, w, e) {
var i1000000 = i % 1000000;
return B(0, 1, i) ? 0 : e === 0 && i !== 0 && i1000000 === 0 && v === 0 || !B(0, 5, e) ? 1 : 2;
}
});

add([ 'pt-pt' ], {
c: [ 1, 4, 5 ],
cFn: function (n, i, v, f, t, w, e) {
var i1000000 = i % 1000000;
return i === 1 && v === 0 ? 0 : e === 0 && i !== 0 && i1000000 === 0 && v === 0 || !B(0, 5, e) ? 1 : 2;
}
});

Expand All @@ -1469,6 +1543,17 @@ add([ 'ru' ], {
}
});

add([ 'sc', 'scn' ], {
c: [ 1, 5 ],
cFn: function (n, i, v) {
return i === 1 && v === 0 ? 0 : 1;
},
o: [ 4, 5 ],
oFn: function (n) {
return IN([ 11, 8, 80, 800 ], n) ? 0 : 1;
}
});

add([ 'shi' ], {
c: [ 1, 3, 5 ],
cFn: function (n, i) {
Expand Down Expand Up @@ -2166,7 +2251,7 @@ BabelFish.prototype.t = BabelFish.prototype.translate;
* BabelFish#stringify(locale) -> String
* - locale (String): Locale of translation
*
* Returns serialized locale data, uncluding fallbacks.
* Returns serialized locale data, including fallbacks.
* It can be loaded back via `load()` method.
**/
BabelFish.prototype.stringify = function _stringify(locale) {
Expand Down
Loading

0 comments on commit 4322695

Please sign in to comment.