@pie-lib/translator 2.23.2-next.11 → 2.23.2-next.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -64
- package/esm/index.js +77 -116
- package/esm/index.js.map +1 -1
- package/lib/en.js +2 -3
- package/lib/en.js.map +1 -1
- package/lib/es.js +1 -2
- package/lib/es.js.map +1 -1
- package/lib/index.js +3 -17
- package/lib/index.js.map +1 -1
- package/package.json +8 -4
- package/src/__tests__/index.test.js +278 -0
- package/src/en.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,129 +7,71 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-lib/translator
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
10
|
# [2.23.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.19.0...@pie-lib/translator@2.23.0) (2025-10-16)
|
|
15
11
|
|
|
16
12
|
**Note:** Version bump only for package @pie-lib/translator
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
14
|
# [2.22.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.19.0...@pie-lib/translator@2.22.0) (2025-10-16)
|
|
23
15
|
|
|
24
16
|
**Note:** Version bump only for package @pie-lib/translator
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
18
|
# [2.21.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.19.0...@pie-lib/translator@2.21.0) (2025-10-16)
|
|
31
19
|
|
|
32
20
|
**Note:** Version bump only for package @pie-lib/translator
|
|
33
21
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
22
|
# [2.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.19.0...@pie-lib/translator@2.20.0) (2025-10-16)
|
|
39
23
|
|
|
40
24
|
**Note:** Version bump only for package @pie-lib/translator
|
|
41
25
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
26
|
# [2.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.3.0...@pie-lib/translator@2.19.0) (2025-09-25)
|
|
47
27
|
|
|
48
|
-
|
|
49
28
|
### Bug Fixes
|
|
50
29
|
|
|
51
|
-
|
|
52
|
-
|
|
30
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
53
31
|
|
|
54
32
|
### Features
|
|
55
33
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
61
35
|
|
|
62
36
|
# [2.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.17.0...@pie-lib/translator@2.18.0) (2025-09-18)
|
|
63
37
|
|
|
64
38
|
**Note:** Version bump only for package @pie-lib/translator
|
|
65
39
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
40
|
# [2.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.16.0...@pie-lib/translator@2.17.0) (2025-09-18)
|
|
71
41
|
|
|
72
42
|
**Note:** Version bump only for package @pie-lib/translator
|
|
73
43
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
44
|
# [2.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.3.0...@pie-lib/translator@2.16.0) (2025-09-18)
|
|
79
45
|
|
|
80
|
-
|
|
81
46
|
### Bug Fixes
|
|
82
47
|
|
|
83
|
-
|
|
84
|
-
|
|
48
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
85
49
|
|
|
86
50
|
### Features
|
|
87
51
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
52
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
93
53
|
|
|
94
54
|
# [2.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.14.0...@pie-lib/translator@2.15.0) (2025-09-17)
|
|
95
55
|
|
|
96
56
|
**Note:** Version bump only for package @pie-lib/translator
|
|
97
57
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
58
|
# [2.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.13.0...@pie-lib/translator@2.14.0) (2025-09-17)
|
|
103
59
|
|
|
104
60
|
**Note:** Version bump only for package @pie-lib/translator
|
|
105
61
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
62
|
# [2.13.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.12.1...@pie-lib/translator@2.13.0) (2025-09-17)
|
|
111
63
|
|
|
112
64
|
**Note:** Version bump only for package @pie-lib/translator
|
|
113
65
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
66
|
## [2.12.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.3.0...@pie-lib/translator@2.12.1) (2025-08-11)
|
|
119
67
|
|
|
120
|
-
|
|
121
68
|
### Bug Fixes
|
|
122
69
|
|
|
123
|
-
|
|
124
|
-
|
|
70
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
125
71
|
|
|
126
72
|
### Features
|
|
127
73
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
74
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
133
75
|
|
|
134
76
|
# [2.12.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/translator@2.3.0...@pie-lib/translator@2.12.0) (2025-08-07)
|
|
135
77
|
|
package/esm/index.js
CHANGED
|
@@ -1,163 +1,128 @@
|
|
|
1
1
|
function _extends() {
|
|
2
|
-
_extends = Object.assign
|
|
3
|
-
for (var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
for (var key in source) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8
|
-
target[key] = source[key];
|
|
9
|
-
}
|
|
10
|
-
}
|
|
2
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
3
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
4
|
+
var t = arguments[e];
|
|
5
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
11
6
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
return _extends.apply(this, arguments);
|
|
7
|
+
return n;
|
|
8
|
+
}, _extends.apply(null, arguments);
|
|
17
9
|
}
|
|
18
10
|
|
|
19
|
-
function _typeof(
|
|
11
|
+
function _typeof(o) {
|
|
20
12
|
"@babel/helpers - typeof";
|
|
21
13
|
|
|
22
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
23
|
-
return typeof
|
|
24
|
-
} : function (
|
|
25
|
-
return
|
|
26
|
-
}, _typeof(
|
|
14
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
15
|
+
return typeof o;
|
|
16
|
+
} : function (o) {
|
|
17
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
18
|
+
}, _typeof(o);
|
|
27
19
|
}
|
|
28
20
|
|
|
29
|
-
function _classCallCheck(
|
|
30
|
-
if (!(
|
|
31
|
-
throw new TypeError("Cannot call a class as a function");
|
|
32
|
-
}
|
|
21
|
+
function _classCallCheck(a, n) {
|
|
22
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
33
23
|
}
|
|
34
24
|
|
|
35
|
-
function
|
|
36
|
-
if (
|
|
37
|
-
var
|
|
38
|
-
if (
|
|
39
|
-
var
|
|
40
|
-
if (
|
|
25
|
+
function toPrimitive(t, r) {
|
|
26
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
27
|
+
var e = t[Symbol.toPrimitive];
|
|
28
|
+
if (void 0 !== e) {
|
|
29
|
+
var i = e.call(t, r);
|
|
30
|
+
if ("object" != _typeof(i)) return i;
|
|
41
31
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
42
32
|
}
|
|
43
|
-
return (
|
|
33
|
+
return ("string" === r ? String : Number)(t);
|
|
44
34
|
}
|
|
45
35
|
|
|
46
|
-
function
|
|
47
|
-
var
|
|
48
|
-
return _typeof(
|
|
36
|
+
function toPropertyKey(t) {
|
|
37
|
+
var i = toPrimitive(t, "string");
|
|
38
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
49
39
|
}
|
|
50
40
|
|
|
51
|
-
function _defineProperties(
|
|
52
|
-
for (var
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
descriptor.configurable = true;
|
|
56
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
57
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
41
|
+
function _defineProperties(e, r) {
|
|
42
|
+
for (var t = 0; t < r.length; t++) {
|
|
43
|
+
var o = r[t];
|
|
44
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
58
45
|
}
|
|
59
46
|
}
|
|
60
|
-
function _createClass(
|
|
61
|
-
|
|
62
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
63
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
47
|
+
function _createClass(e, r, t) {
|
|
48
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
64
49
|
writable: false
|
|
65
|
-
});
|
|
66
|
-
return Constructor;
|
|
50
|
+
}), e;
|
|
67
51
|
}
|
|
68
52
|
|
|
69
|
-
function _assertThisInitialized(
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return self;
|
|
53
|
+
function _assertThisInitialized(e) {
|
|
54
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
55
|
+
return e;
|
|
74
56
|
}
|
|
75
57
|
|
|
76
|
-
function _setPrototypeOf(
|
|
77
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
return _setPrototypeOf(o, p);
|
|
58
|
+
function _setPrototypeOf(t, e) {
|
|
59
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
60
|
+
return t.__proto__ = e, t;
|
|
61
|
+
}, _setPrototypeOf(t, e);
|
|
82
62
|
}
|
|
83
63
|
|
|
84
|
-
function _inherits(
|
|
85
|
-
if (typeof
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
64
|
+
function _inherits(t, e) {
|
|
65
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
66
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
89
67
|
constructor: {
|
|
90
|
-
value:
|
|
68
|
+
value: t,
|
|
91
69
|
writable: true,
|
|
92
70
|
configurable: true
|
|
93
71
|
}
|
|
94
|
-
})
|
|
95
|
-
Object.defineProperty(subClass, "prototype", {
|
|
72
|
+
}), Object.defineProperty(t, "prototype", {
|
|
96
73
|
writable: false
|
|
97
|
-
});
|
|
98
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
74
|
+
}), e && _setPrototypeOf(t, e);
|
|
99
75
|
}
|
|
100
76
|
|
|
101
|
-
function _possibleConstructorReturn(
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
106
|
-
}
|
|
107
|
-
return _assertThisInitialized(self);
|
|
77
|
+
function _possibleConstructorReturn(t, e) {
|
|
78
|
+
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
79
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
80
|
+
return _assertThisInitialized(t);
|
|
108
81
|
}
|
|
109
82
|
|
|
110
|
-
function _getPrototypeOf(
|
|
111
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function
|
|
112
|
-
return
|
|
113
|
-
};
|
|
114
|
-
return _getPrototypeOf(o);
|
|
83
|
+
function _getPrototypeOf(t) {
|
|
84
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
85
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
86
|
+
}, _getPrototypeOf(t);
|
|
115
87
|
}
|
|
116
88
|
|
|
117
|
-
function _defineProperty(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
writable: true
|
|
125
|
-
});
|
|
126
|
-
} else {
|
|
127
|
-
obj[key] = value;
|
|
128
|
-
}
|
|
129
|
-
return obj;
|
|
89
|
+
function _defineProperty(e, r, t) {
|
|
90
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
91
|
+
value: t,
|
|
92
|
+
enumerable: true,
|
|
93
|
+
configurable: true,
|
|
94
|
+
writable: true
|
|
95
|
+
}) : e[r] = t, e;
|
|
130
96
|
}
|
|
131
97
|
|
|
132
|
-
function _arrayWithHoles(
|
|
133
|
-
if (Array.isArray(
|
|
98
|
+
function _arrayWithHoles(r) {
|
|
99
|
+
if (Array.isArray(r)) return r;
|
|
134
100
|
}
|
|
135
101
|
|
|
136
|
-
function _iterableToArray(
|
|
137
|
-
if (typeof Symbol
|
|
102
|
+
function _iterableToArray(r) {
|
|
103
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
138
104
|
}
|
|
139
105
|
|
|
140
|
-
function _arrayLikeToArray(
|
|
141
|
-
|
|
142
|
-
for (var
|
|
143
|
-
return
|
|
106
|
+
function _arrayLikeToArray(r, a) {
|
|
107
|
+
(null == a || a > r.length) && (a = r.length);
|
|
108
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
109
|
+
return n;
|
|
144
110
|
}
|
|
145
111
|
|
|
146
|
-
function _unsupportedIterableToArray(
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
112
|
+
function _unsupportedIterableToArray(r, a) {
|
|
113
|
+
if (r) {
|
|
114
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
115
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
116
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
117
|
+
}
|
|
153
118
|
}
|
|
154
119
|
|
|
155
120
|
function _nonIterableRest() {
|
|
156
121
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
157
122
|
}
|
|
158
123
|
|
|
159
|
-
function _toArray(
|
|
160
|
-
return _arrayWithHoles(
|
|
124
|
+
function _toArray(r) {
|
|
125
|
+
return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest();
|
|
161
126
|
}
|
|
162
127
|
|
|
163
128
|
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -532,8 +497,7 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
532
497
|
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
533
498
|
silent: false
|
|
534
499
|
};
|
|
535
|
-
var keySeparator = this.options.keySeparator;
|
|
536
|
-
if (keySeparator === undefined) keySeparator = '.';
|
|
500
|
+
var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
537
501
|
var path = [lng, ns];
|
|
538
502
|
if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
539
503
|
if (lng.indexOf('.') > -1) {
|
|
@@ -2667,7 +2631,7 @@ instance.loadLanguages;
|
|
|
2667
2631
|
var en = {
|
|
2668
2632
|
translation: {
|
|
2669
2633
|
categorize: {
|
|
2670
|
-
limitMaxChoicesPerCategory:
|
|
2634
|
+
limitMaxChoicesPerCategory: 'You\'ve reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.',
|
|
2671
2635
|
maxChoicesPerCategoryRestriction: 'To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].'
|
|
2672
2636
|
},
|
|
2673
2637
|
ebsr: {
|
|
@@ -2869,14 +2833,12 @@ var index = {
|
|
|
2869
2833
|
const {
|
|
2870
2834
|
lng
|
|
2871
2835
|
} = options;
|
|
2872
|
-
|
|
2873
2836
|
switch (lng) {
|
|
2874
2837
|
// these keys don't work with plurals, don't know why, so I added a workaround to convert them to the correct lng
|
|
2875
2838
|
case 'en_US':
|
|
2876
2839
|
case 'en-US':
|
|
2877
2840
|
options.lng = 'en';
|
|
2878
2841
|
break;
|
|
2879
|
-
|
|
2880
2842
|
case 'es_ES':
|
|
2881
2843
|
case 'es-ES':
|
|
2882
2844
|
case 'es_MX':
|
|
@@ -2884,7 +2846,6 @@ var index = {
|
|
|
2884
2846
|
options.lng = 'es';
|
|
2885
2847
|
break;
|
|
2886
2848
|
}
|
|
2887
|
-
|
|
2888
2849
|
return instance.t(key, _extends({
|
|
2889
2850
|
lng
|
|
2890
2851
|
}, options));
|