vue-i18n 11.4.0 → 11.4.2
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/dist/vue-i18n.cjs +60 -51
- package/dist/vue-i18n.esm-browser.js +61 -52
- package/dist/vue-i18n.esm-browser.prod.js +2 -2
- package/dist/vue-i18n.global.js +61 -52
- package/dist/vue-i18n.global.prod.js +2 -2
- package/dist/vue-i18n.mjs +60 -51
- package/dist/vue-i18n.node.mjs +60 -51
- package/dist/vue-i18n.prod.cjs +60 -51
- package/dist/vue-i18n.runtime.esm-browser.js +61 -52
- package/dist/vue-i18n.runtime.esm-browser.prod.js +2 -2
- package/dist/vue-i18n.runtime.global.js +61 -52
- package/dist/vue-i18n.runtime.global.prod.js +2 -2
- package/dist/vue-i18n.runtime.mjs +60 -51
- package/dist/vue-i18n.runtime.node.mjs +60 -51
- package/package.json +4 -4
package/dist/vue-i18n.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v11.4.
|
|
2
|
+
* vue-i18n v11.4.2
|
|
3
3
|
* (c) 2026 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -30,7 +30,7 @@ var Vue__namespace = /*#__PURE__*/_interopNamespaceDefault(Vue);
|
|
|
30
30
|
*
|
|
31
31
|
* @VueI18nGeneral
|
|
32
32
|
*/
|
|
33
|
-
const VERSION = '11.4.
|
|
33
|
+
const VERSION = '11.4.2';
|
|
34
34
|
|
|
35
35
|
const I18nErrorCodes = {
|
|
36
36
|
// composer module errors
|
|
@@ -1221,22 +1221,26 @@ const TranslationImpl = /*#__PURE__*/ Vue.defineComponent({
|
|
|
1221
1221
|
__useComponent: true
|
|
1222
1222
|
});
|
|
1223
1223
|
return () => {
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1224
|
+
const renderChildren = () => {
|
|
1225
|
+
const keys = Object.keys(slots).filter(key => key[0] !== '_');
|
|
1226
|
+
const options = shared.create();
|
|
1227
|
+
if (props.locale) {
|
|
1228
|
+
options.locale = props.locale;
|
|
1229
|
+
}
|
|
1230
|
+
if (props.plural !== undefined) {
|
|
1231
|
+
options.plural = shared.isString(props.plural) ? +props.plural : props.plural;
|
|
1232
|
+
}
|
|
1233
|
+
const arg = getInterpolateArg(context, keys);
|
|
1234
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1235
|
+
return i18n[TranslateVNodeSymbol](props.keypath, arg, options);
|
|
1236
|
+
};
|
|
1235
1237
|
const assignedAttrs = shared.assign(shared.create(), attrs);
|
|
1236
1238
|
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1237
1239
|
? props.tag
|
|
1238
1240
|
: getFragmentableTag();
|
|
1239
|
-
return
|
|
1241
|
+
return shared.isObject(tag)
|
|
1242
|
+
? Vue.h(tag, assignedAttrs, { default: renderChildren })
|
|
1243
|
+
: Vue.h(tag, assignedAttrs, renderChildren());
|
|
1240
1244
|
};
|
|
1241
1245
|
}
|
|
1242
1246
|
});
|
|
@@ -1302,49 +1306,54 @@ function isVNode(target) {
|
|
|
1302
1306
|
function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
1303
1307
|
const { slots, attrs } = context;
|
|
1304
1308
|
return () => {
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
if (shared.isString(props.format)) {
|
|
1311
|
-
options.key = props.format;
|
|
1312
|
-
}
|
|
1313
|
-
else if (shared.isObject(props.format)) {
|
|
1314
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1315
|
-
if (shared.isString(props.format.key)) {
|
|
1316
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1317
|
-
options.key = props.format.key;
|
|
1309
|
+
const renderChildren = () => {
|
|
1310
|
+
const options = { part: true };
|
|
1311
|
+
let overrides = shared.create();
|
|
1312
|
+
if (props.locale) {
|
|
1313
|
+
options.locale = props.locale;
|
|
1318
1314
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
let children = [options.key];
|
|
1328
|
-
if (shared.isArray(parts)) {
|
|
1329
|
-
children = parts.map((part, index) => {
|
|
1330
|
-
const slot = slots[part.type];
|
|
1331
|
-
const node = slot
|
|
1332
|
-
? slot({ [part.type]: part.value, index, parts })
|
|
1333
|
-
: [part.value];
|
|
1334
|
-
if (isVNode(node)) {
|
|
1335
|
-
node[0].key = `${part.type}-${index}`;
|
|
1315
|
+
if (shared.isString(props.format)) {
|
|
1316
|
+
options.key = props.format;
|
|
1317
|
+
}
|
|
1318
|
+
else if (shared.isObject(props.format)) {
|
|
1319
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1320
|
+
if (shared.isString(props.format.key)) {
|
|
1321
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1322
|
+
options.key = props.format.key;
|
|
1336
1323
|
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1324
|
+
// Filter out number format options only
|
|
1325
|
+
overrides = Object.keys(props.format).reduce((options, prop) => {
|
|
1326
|
+
return slotKeys.includes(prop)
|
|
1327
|
+
? shared.assign(shared.create(), options, { [prop]: props.format[prop] }) // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1328
|
+
: options;
|
|
1329
|
+
}, shared.create());
|
|
1330
|
+
}
|
|
1331
|
+
const parts = partFormatter(...[props.value, options, overrides]);
|
|
1332
|
+
let children = [options.key];
|
|
1333
|
+
if (shared.isArray(parts)) {
|
|
1334
|
+
children = parts.map((part, index) => {
|
|
1335
|
+
const slot = slots[part.type];
|
|
1336
|
+
const node = slot
|
|
1337
|
+
? slot({ [part.type]: part.value, index, parts })
|
|
1338
|
+
: [part.value];
|
|
1339
|
+
if (isVNode(node)) {
|
|
1340
|
+
node[0].key = `${part.type}-${index}`;
|
|
1341
|
+
}
|
|
1342
|
+
return node;
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
else if (shared.isString(parts)) {
|
|
1346
|
+
children = [parts];
|
|
1347
|
+
}
|
|
1348
|
+
return children;
|
|
1349
|
+
};
|
|
1343
1350
|
const assignedAttrs = shared.assign(shared.create(), attrs);
|
|
1344
1351
|
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1345
1352
|
? props.tag
|
|
1346
1353
|
: getFragmentableTag();
|
|
1347
|
-
return
|
|
1354
|
+
return shared.isObject(tag)
|
|
1355
|
+
? Vue.h(tag, assignedAttrs, { default: renderChildren })
|
|
1356
|
+
: Vue.h(tag, assignedAttrs, renderChildren());
|
|
1348
1357
|
};
|
|
1349
1358
|
}
|
|
1350
1359
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v11.4.
|
|
2
|
+
* vue-i18n v11.4.2
|
|
3
3
|
* (c) 2026 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2549,7 +2549,7 @@ function getWarnMessage$1(code, ...args) {
|
|
|
2549
2549
|
* Intlify core-base version
|
|
2550
2550
|
* @internal
|
|
2551
2551
|
*/
|
|
2552
|
-
const VERSION$1 = '11.4.
|
|
2552
|
+
const VERSION$1 = '11.4.2';
|
|
2553
2553
|
const NOT_REOSLVED = -1;
|
|
2554
2554
|
const DEFAULT_LOCALE = 'en-US';
|
|
2555
2555
|
const MISSING_RESOLVE_VALUE = '';
|
|
@@ -3681,7 +3681,7 @@ function getMessageContextOptions(context, locale, message, options) {
|
|
|
3681
3681
|
*
|
|
3682
3682
|
* @VueI18nGeneral
|
|
3683
3683
|
*/
|
|
3684
|
-
const VERSION = '11.4.
|
|
3684
|
+
const VERSION = '11.4.2';
|
|
3685
3685
|
/**
|
|
3686
3686
|
* This is only called development env
|
|
3687
3687
|
* istanbul-ignore-next
|
|
@@ -5564,22 +5564,26 @@ const TranslationImpl = /*#__PURE__*/ defineComponent({
|
|
|
5564
5564
|
__useComponent: true
|
|
5565
5565
|
});
|
|
5566
5566
|
return () => {
|
|
5567
|
-
const
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5567
|
+
const renderChildren = () => {
|
|
5568
|
+
const keys = Object.keys(slots).filter(key => key[0] !== '_');
|
|
5569
|
+
const options = create();
|
|
5570
|
+
if (props.locale) {
|
|
5571
|
+
options.locale = props.locale;
|
|
5572
|
+
}
|
|
5573
|
+
if (props.plural !== undefined) {
|
|
5574
|
+
options.plural = isString(props.plural) ? +props.plural : props.plural;
|
|
5575
|
+
}
|
|
5576
|
+
const arg = getInterpolateArg(context, keys);
|
|
5577
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5578
|
+
return i18n[TranslateVNodeSymbol](props.keypath, arg, options);
|
|
5579
|
+
};
|
|
5578
5580
|
const assignedAttrs = assign(create(), attrs);
|
|
5579
5581
|
const tag = isString(props.tag) || isObject(props.tag)
|
|
5580
5582
|
? props.tag
|
|
5581
5583
|
: getFragmentableTag();
|
|
5582
|
-
return
|
|
5584
|
+
return isObject(tag)
|
|
5585
|
+
? h(tag, assignedAttrs, { default: renderChildren })
|
|
5586
|
+
: h(tag, assignedAttrs, renderChildren());
|
|
5583
5587
|
};
|
|
5584
5588
|
}
|
|
5585
5589
|
});
|
|
@@ -5645,49 +5649,54 @@ function isVNode(target) {
|
|
|
5645
5649
|
function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
5646
5650
|
const { slots, attrs } = context;
|
|
5647
5651
|
return () => {
|
|
5648
|
-
const
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
if (isString(props.format.key)) {
|
|
5652
|
+
const renderChildren = () => {
|
|
5653
|
+
const options = { part: true };
|
|
5654
|
+
let overrides = create();
|
|
5655
|
+
if (props.locale) {
|
|
5656
|
+
options.locale = props.locale;
|
|
5657
|
+
}
|
|
5658
|
+
if (isString(props.format)) {
|
|
5659
|
+
options.key = props.format;
|
|
5660
|
+
}
|
|
5661
|
+
else if (isObject(props.format)) {
|
|
5659
5662
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
overrides = Object.keys(props.format).reduce((options, prop) => {
|
|
5664
|
-
return slotKeys.includes(prop)
|
|
5665
|
-
? assign(create(), options, { [prop]: props.format[prop] }) // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
5666
|
-
: options;
|
|
5667
|
-
}, create());
|
|
5668
|
-
}
|
|
5669
|
-
const parts = partFormatter(...[props.value, options, overrides]);
|
|
5670
|
-
let children = [options.key];
|
|
5671
|
-
if (isArray(parts)) {
|
|
5672
|
-
children = parts.map((part, index) => {
|
|
5673
|
-
const slot = slots[part.type];
|
|
5674
|
-
const node = slot
|
|
5675
|
-
? slot({ [part.type]: part.value, index, parts })
|
|
5676
|
-
: [part.value];
|
|
5677
|
-
if (isVNode(node)) {
|
|
5678
|
-
node[0].key = `${part.type}-${index}`;
|
|
5663
|
+
if (isString(props.format.key)) {
|
|
5664
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5665
|
+
options.key = props.format.key;
|
|
5679
5666
|
}
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5667
|
+
// Filter out number format options only
|
|
5668
|
+
overrides = Object.keys(props.format).reduce((options, prop) => {
|
|
5669
|
+
return slotKeys.includes(prop)
|
|
5670
|
+
? assign(create(), options, { [prop]: props.format[prop] }) // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
5671
|
+
: options;
|
|
5672
|
+
}, create());
|
|
5673
|
+
}
|
|
5674
|
+
const parts = partFormatter(...[props.value, options, overrides]);
|
|
5675
|
+
let children = [options.key];
|
|
5676
|
+
if (isArray(parts)) {
|
|
5677
|
+
children = parts.map((part, index) => {
|
|
5678
|
+
const slot = slots[part.type];
|
|
5679
|
+
const node = slot
|
|
5680
|
+
? slot({ [part.type]: part.value, index, parts })
|
|
5681
|
+
: [part.value];
|
|
5682
|
+
if (isVNode(node)) {
|
|
5683
|
+
node[0].key = `${part.type}-${index}`;
|
|
5684
|
+
}
|
|
5685
|
+
return node;
|
|
5686
|
+
});
|
|
5687
|
+
}
|
|
5688
|
+
else if (isString(parts)) {
|
|
5689
|
+
children = [parts];
|
|
5690
|
+
}
|
|
5691
|
+
return children;
|
|
5692
|
+
};
|
|
5686
5693
|
const assignedAttrs = assign(create(), attrs);
|
|
5687
5694
|
const tag = isString(props.tag) || isObject(props.tag)
|
|
5688
5695
|
? props.tag
|
|
5689
5696
|
: getFragmentableTag();
|
|
5690
|
-
return
|
|
5697
|
+
return isObject(tag)
|
|
5698
|
+
? h(tag, assignedAttrs, { default: renderChildren })
|
|
5699
|
+
: h(tag, assignedAttrs, renderChildren());
|
|
5691
5700
|
};
|
|
5692
5701
|
}
|
|
5693
5702
|
|