vue-i18n 9.2.0-beta.21 → 9.2.0-beta.22
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.js +53 -37
- package/dist/vue-i18n.cjs.prod.js +52 -37
- package/dist/vue-i18n.d.ts +82 -128
- package/dist/vue-i18n.esm-browser.js +55 -39
- package/dist/vue-i18n.esm-browser.prod.js +2 -2
- package/dist/vue-i18n.esm-bundler.js +56 -42
- package/dist/vue-i18n.global.js +54 -38
- package/dist/vue-i18n.global.prod.js +2 -2
- package/dist/vue-i18n.runtime.esm-browser.js +55 -39
- package/dist/vue-i18n.runtime.esm-browser.prod.js +2 -2
- package/dist/vue-i18n.runtime.esm-bundler.js +56 -42
- package/dist/vue-i18n.runtime.global.js +54 -38
- package/dist/vue-i18n.runtime.global.prod.js +2 -2
- package/package.json +5 -5
package/dist/vue-i18n.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v9.2.0-beta.
|
|
2
|
+
* vue-i18n v9.2.0-beta.22
|
|
3
3
|
* (c) 2021 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -19,7 +19,7 @@ var vue = require('vue');
|
|
|
19
19
|
*
|
|
20
20
|
* @VueI18nGeneral
|
|
21
21
|
*/
|
|
22
|
-
const VERSION = '9.2.0-beta.
|
|
22
|
+
const VERSION = '9.2.0-beta.22';
|
|
23
23
|
|
|
24
24
|
let code$1 = coreBase.CoreWarnCodes.__EXTEND_POINT__;
|
|
25
25
|
const inc$1 = () => code$1++;
|
|
@@ -244,9 +244,14 @@ function adjustI18nResources(global, options, componentOptions // eslint-disable
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
+
function createTextNode(key) {
|
|
248
|
+
return vue.createVNode(vue.Text, null, key, 0)
|
|
249
|
+
;
|
|
250
|
+
}
|
|
247
251
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
248
252
|
|
|
249
253
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
254
|
+
// extend VNode interface
|
|
250
255
|
const DEVTOOLS_META = '__INTLIFY_META__';
|
|
251
256
|
let composerID = 0;
|
|
252
257
|
function defineCoreMissingHandler(missing) {
|
|
@@ -518,7 +523,7 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
518
523
|
}
|
|
519
524
|
// for custom processor
|
|
520
525
|
function normalize(values) {
|
|
521
|
-
return values.map(val => shared.isString(val) ?
|
|
526
|
+
return values.map(val => (shared.isString(val) ? createTextNode(val) : val));
|
|
522
527
|
}
|
|
523
528
|
const interpolate = (val) => val;
|
|
524
529
|
const processor = {
|
|
@@ -541,7 +546,7 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
541
546
|
return ret;
|
|
542
547
|
}, () => coreBase.parseTranslateArgs(...args), 'translate',
|
|
543
548
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
544
|
-
root => root[TransrateVNodeSymbol](...args), key => [
|
|
549
|
+
root => root[TransrateVNodeSymbol](...args), key => [createTextNode(key)], val => shared.isArray(val));
|
|
545
550
|
}
|
|
546
551
|
// numberParts, using for `i18n-n` component
|
|
547
552
|
function numberParts(...args) {
|
|
@@ -749,11 +754,9 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
749
754
|
composer.setNumberFormat = setNumberFormat;
|
|
750
755
|
composer.mergeNumberFormat = mergeNumberFormat;
|
|
751
756
|
composer[InejctWithOption] = options.__injectWithOption;
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
composer[DatetimePartsSymbol] = datetimeParts;
|
|
756
|
-
}
|
|
757
|
+
composer[TransrateVNodeSymbol] = transrateVNode;
|
|
758
|
+
composer[DatetimePartsSymbol] = datetimeParts;
|
|
759
|
+
composer[NumberPartsSymbol] = numberParts;
|
|
757
760
|
}
|
|
758
761
|
// for vue-devtools timeline event
|
|
759
762
|
{
|
|
@@ -1156,6 +1159,30 @@ const baseFormatProps = {
|
|
|
1156
1159
|
}
|
|
1157
1160
|
};
|
|
1158
1161
|
|
|
1162
|
+
function getInterpolateArg(
|
|
1163
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1164
|
+
{ slots }, // SetupContext,
|
|
1165
|
+
keys) {
|
|
1166
|
+
if (keys.length === 1 && keys[0] === 'default') {
|
|
1167
|
+
// default slot only
|
|
1168
|
+
return slots.default ? slots.default() : [];
|
|
1169
|
+
}
|
|
1170
|
+
else {
|
|
1171
|
+
// named slots
|
|
1172
|
+
return keys.reduce((arg, key) => {
|
|
1173
|
+
const slot = slots[key];
|
|
1174
|
+
if (slot) {
|
|
1175
|
+
arg[key] = slot();
|
|
1176
|
+
}
|
|
1177
|
+
return arg;
|
|
1178
|
+
}, {});
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1182
|
+
function getFragmentableTag(tag) {
|
|
1183
|
+
return vue.Fragment ;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1159
1186
|
/**
|
|
1160
1187
|
* Translation Component
|
|
1161
1188
|
*
|
|
@@ -1205,7 +1232,7 @@ const baseFormatProps = {
|
|
|
1205
1232
|
*
|
|
1206
1233
|
* @VueI18nComponent
|
|
1207
1234
|
*/
|
|
1208
|
-
const Translation =
|
|
1235
|
+
const Translation = /* defineComponent */ {
|
|
1209
1236
|
/* eslint-disable */
|
|
1210
1237
|
name: 'i18n-t',
|
|
1211
1238
|
props: shared.assign({
|
|
@@ -1220,6 +1247,7 @@ const Translation = /* #__PURE__*/ vue.defineComponent({
|
|
|
1220
1247
|
}
|
|
1221
1248
|
}, baseFormatProps),
|
|
1222
1249
|
/* eslint-enable */
|
|
1250
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1223
1251
|
setup(props, context) {
|
|
1224
1252
|
const { slots, attrs } = context;
|
|
1225
1253
|
// NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
|
|
@@ -1241,27 +1269,13 @@ const Translation = /* #__PURE__*/ vue.defineComponent({
|
|
|
1241
1269
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1242
1270
|
const children = i18n[TransrateVNodeSymbol](props.keypath, arg, options);
|
|
1243
1271
|
const assignedAttrs = shared.assign({}, attrs);
|
|
1244
|
-
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1272
|
+
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1273
|
+
? props.tag
|
|
1274
|
+
: getFragmentableTag();
|
|
1245
1275
|
return vue.h(tag, assignedAttrs, children);
|
|
1246
1276
|
};
|
|
1247
1277
|
}
|
|
1248
|
-
}
|
|
1249
|
-
function getInterpolateArg({ slots }, keys) {
|
|
1250
|
-
if (keys.length === 1 && keys[0] === 'default') {
|
|
1251
|
-
// default slot only
|
|
1252
|
-
return slots.default ? slots.default() : [];
|
|
1253
|
-
}
|
|
1254
|
-
else {
|
|
1255
|
-
// named slots
|
|
1256
|
-
return keys.reduce((arg, key) => {
|
|
1257
|
-
const slot = slots[key];
|
|
1258
|
-
if (slot) {
|
|
1259
|
-
arg[key] = slot();
|
|
1260
|
-
}
|
|
1261
|
-
return arg;
|
|
1262
|
-
}, {});
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1278
|
+
};
|
|
1265
1279
|
|
|
1266
1280
|
function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
1267
1281
|
const { slots, attrs } = context;
|
|
@@ -1301,7 +1315,9 @@ function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
|
1301
1315
|
children = [parts];
|
|
1302
1316
|
}
|
|
1303
1317
|
const assignedAttrs = shared.assign({}, attrs);
|
|
1304
|
-
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1318
|
+
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1319
|
+
? props.tag
|
|
1320
|
+
: getFragmentableTag();
|
|
1305
1321
|
return vue.h(tag, assignedAttrs, children);
|
|
1306
1322
|
};
|
|
1307
1323
|
}
|
|
@@ -1340,7 +1356,7 @@ const NUMBER_FORMAT_KEYS = [
|
|
|
1340
1356
|
*
|
|
1341
1357
|
* @VueI18nComponent
|
|
1342
1358
|
*/
|
|
1343
|
-
const NumberFormat =
|
|
1359
|
+
const NumberFormat = /* defineComponent */ {
|
|
1344
1360
|
/* eslint-disable */
|
|
1345
1361
|
name: 'i18n-n',
|
|
1346
1362
|
props: shared.assign({
|
|
@@ -1353,6 +1369,7 @@ const NumberFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1353
1369
|
}
|
|
1354
1370
|
}, baseFormatProps),
|
|
1355
1371
|
/* eslint-enable */
|
|
1372
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1356
1373
|
setup(props, context) {
|
|
1357
1374
|
const i18n = props.i18n ||
|
|
1358
1375
|
useI18n({ useScope: 'parent', __useComponent: true });
|
|
@@ -1360,7 +1377,7 @@ const NumberFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1360
1377
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1361
1378
|
i18n[NumberPartsSymbol](...args));
|
|
1362
1379
|
}
|
|
1363
|
-
}
|
|
1380
|
+
};
|
|
1364
1381
|
|
|
1365
1382
|
const DATETIME_FORMAT_KEYS = [
|
|
1366
1383
|
'dateStyle',
|
|
@@ -1401,7 +1418,7 @@ const DATETIME_FORMAT_KEYS = [
|
|
|
1401
1418
|
*
|
|
1402
1419
|
* @VueI18nComponent
|
|
1403
1420
|
*/
|
|
1404
|
-
const DatetimeFormat =
|
|
1421
|
+
const DatetimeFormat = /*defineComponent */ {
|
|
1405
1422
|
/* eslint-disable */
|
|
1406
1423
|
name: 'i18n-d',
|
|
1407
1424
|
props: shared.assign({
|
|
@@ -1414,6 +1431,7 @@ const DatetimeFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1414
1431
|
}
|
|
1415
1432
|
}, baseFormatProps),
|
|
1416
1433
|
/* eslint-enable */
|
|
1434
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1417
1435
|
setup(props, context) {
|
|
1418
1436
|
const i18n = props.i18n ||
|
|
1419
1437
|
useI18n({ useScope: 'parent', __useComponent: true });
|
|
@@ -1421,7 +1439,7 @@ const DatetimeFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1421
1439
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1422
1440
|
i18n[DatetimePartsSymbol](...args));
|
|
1423
1441
|
}
|
|
1424
|
-
}
|
|
1442
|
+
};
|
|
1425
1443
|
|
|
1426
1444
|
function getComposer$1(i18n, instance) {
|
|
1427
1445
|
const i18nInternal = i18n;
|
|
@@ -1663,10 +1681,8 @@ function createI18n(options = {}, VueI18nLegacy) {
|
|
|
1663
1681
|
// install plugin
|
|
1664
1682
|
async install(app, ...options) {
|
|
1665
1683
|
// setup global provider
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
app.provide(app.__VUE_I18N_SYMBOL__, i18n);
|
|
1669
|
-
}
|
|
1684
|
+
app.__VUE_I18N_SYMBOL__ = symbol;
|
|
1685
|
+
app.provide(app.__VUE_I18N_SYMBOL__, i18n);
|
|
1670
1686
|
// global method and properties injection for Composition API
|
|
1671
1687
|
if (!__legacyMode && __globalInjection) {
|
|
1672
1688
|
injectGlobalFields(app, i18n.global);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v9.2.0-beta.
|
|
2
|
+
* vue-i18n v9.2.0-beta.22
|
|
3
3
|
* (c) 2021 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -19,7 +19,7 @@ var shared = require('@intlify/shared');
|
|
|
19
19
|
*
|
|
20
20
|
* @VueI18nGeneral
|
|
21
21
|
*/
|
|
22
|
-
const VERSION = '9.2.0-beta.
|
|
22
|
+
const VERSION = '9.2.0-beta.22';
|
|
23
23
|
|
|
24
24
|
let code = coreBase.CompileErrorCodes.__EXTEND_POINT__;
|
|
25
25
|
const inc = () => code++;
|
|
@@ -202,6 +202,10 @@ function adjustI18nResources(global, options, componentOptions // eslint-disable
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
+
function createTextNode(key) {
|
|
206
|
+
return vue.createVNode(vue.Text, null, key, 0)
|
|
207
|
+
;
|
|
208
|
+
}
|
|
205
209
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
206
210
|
|
|
207
211
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -428,7 +432,7 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
428
432
|
}
|
|
429
433
|
// for custom processor
|
|
430
434
|
function normalize(values) {
|
|
431
|
-
return values.map(val => shared.isString(val) ?
|
|
435
|
+
return values.map(val => (shared.isString(val) ? createTextNode(val) : val));
|
|
432
436
|
}
|
|
433
437
|
const interpolate = (val) => val;
|
|
434
438
|
const processor = {
|
|
@@ -451,7 +455,7 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
451
455
|
return ret;
|
|
452
456
|
}, () => coreBase.parseTranslateArgs(...args), 'translate',
|
|
453
457
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
454
|
-
root => root[TransrateVNodeSymbol](...args), key => [
|
|
458
|
+
root => root[TransrateVNodeSymbol](...args), key => [createTextNode(key)], val => shared.isArray(val));
|
|
455
459
|
}
|
|
456
460
|
// numberParts, using for `i18n-n` component
|
|
457
461
|
function numberParts(...args) {
|
|
@@ -659,11 +663,9 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
659
663
|
composer.setNumberFormat = setNumberFormat;
|
|
660
664
|
composer.mergeNumberFormat = mergeNumberFormat;
|
|
661
665
|
composer[InejctWithOption] = options.__injectWithOption;
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
composer[DatetimePartsSymbol] = datetimeParts;
|
|
666
|
-
}
|
|
666
|
+
composer[TransrateVNodeSymbol] = transrateVNode;
|
|
667
|
+
composer[DatetimePartsSymbol] = datetimeParts;
|
|
668
|
+
composer[NumberPartsSymbol] = numberParts;
|
|
667
669
|
}
|
|
668
670
|
return composer;
|
|
669
671
|
}
|
|
@@ -1035,6 +1037,30 @@ const baseFormatProps = {
|
|
|
1035
1037
|
}
|
|
1036
1038
|
};
|
|
1037
1039
|
|
|
1040
|
+
function getInterpolateArg(
|
|
1041
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1042
|
+
{ slots }, // SetupContext,
|
|
1043
|
+
keys) {
|
|
1044
|
+
if (keys.length === 1 && keys[0] === 'default') {
|
|
1045
|
+
// default slot only
|
|
1046
|
+
return slots.default ? slots.default() : [];
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
// named slots
|
|
1050
|
+
return keys.reduce((arg, key) => {
|
|
1051
|
+
const slot = slots[key];
|
|
1052
|
+
if (slot) {
|
|
1053
|
+
arg[key] = slot();
|
|
1054
|
+
}
|
|
1055
|
+
return arg;
|
|
1056
|
+
}, {});
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1060
|
+
function getFragmentableTag(tag) {
|
|
1061
|
+
return vue.Fragment ;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1038
1064
|
/**
|
|
1039
1065
|
* Translation Component
|
|
1040
1066
|
*
|
|
@@ -1084,7 +1110,7 @@ const baseFormatProps = {
|
|
|
1084
1110
|
*
|
|
1085
1111
|
* @VueI18nComponent
|
|
1086
1112
|
*/
|
|
1087
|
-
const Translation =
|
|
1113
|
+
const Translation = /* defineComponent */ {
|
|
1088
1114
|
/* eslint-disable */
|
|
1089
1115
|
name: 'i18n-t',
|
|
1090
1116
|
props: shared.assign({
|
|
@@ -1099,6 +1125,7 @@ const Translation = /* #__PURE__*/ vue.defineComponent({
|
|
|
1099
1125
|
}
|
|
1100
1126
|
}, baseFormatProps),
|
|
1101
1127
|
/* eslint-enable */
|
|
1128
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1102
1129
|
setup(props, context) {
|
|
1103
1130
|
const { slots, attrs } = context;
|
|
1104
1131
|
// NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
|
|
@@ -1120,27 +1147,13 @@ const Translation = /* #__PURE__*/ vue.defineComponent({
|
|
|
1120
1147
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1121
1148
|
const children = i18n[TransrateVNodeSymbol](props.keypath, arg, options);
|
|
1122
1149
|
const assignedAttrs = shared.assign({}, attrs);
|
|
1123
|
-
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1150
|
+
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1151
|
+
? props.tag
|
|
1152
|
+
: getFragmentableTag();
|
|
1124
1153
|
return vue.h(tag, assignedAttrs, children);
|
|
1125
1154
|
};
|
|
1126
1155
|
}
|
|
1127
|
-
}
|
|
1128
|
-
function getInterpolateArg({ slots }, keys) {
|
|
1129
|
-
if (keys.length === 1 && keys[0] === 'default') {
|
|
1130
|
-
// default slot only
|
|
1131
|
-
return slots.default ? slots.default() : [];
|
|
1132
|
-
}
|
|
1133
|
-
else {
|
|
1134
|
-
// named slots
|
|
1135
|
-
return keys.reduce((arg, key) => {
|
|
1136
|
-
const slot = slots[key];
|
|
1137
|
-
if (slot) {
|
|
1138
|
-
arg[key] = slot();
|
|
1139
|
-
}
|
|
1140
|
-
return arg;
|
|
1141
|
-
}, {});
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1156
|
+
};
|
|
1144
1157
|
|
|
1145
1158
|
function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
1146
1159
|
const { slots, attrs } = context;
|
|
@@ -1180,7 +1193,9 @@ function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
|
1180
1193
|
children = [parts];
|
|
1181
1194
|
}
|
|
1182
1195
|
const assignedAttrs = shared.assign({}, attrs);
|
|
1183
|
-
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1196
|
+
const tag = shared.isString(props.tag) || shared.isObject(props.tag)
|
|
1197
|
+
? props.tag
|
|
1198
|
+
: getFragmentableTag();
|
|
1184
1199
|
return vue.h(tag, assignedAttrs, children);
|
|
1185
1200
|
};
|
|
1186
1201
|
}
|
|
@@ -1219,7 +1234,7 @@ const NUMBER_FORMAT_KEYS = [
|
|
|
1219
1234
|
*
|
|
1220
1235
|
* @VueI18nComponent
|
|
1221
1236
|
*/
|
|
1222
|
-
const NumberFormat =
|
|
1237
|
+
const NumberFormat = /* defineComponent */ {
|
|
1223
1238
|
/* eslint-disable */
|
|
1224
1239
|
name: 'i18n-n',
|
|
1225
1240
|
props: shared.assign({
|
|
@@ -1232,6 +1247,7 @@ const NumberFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1232
1247
|
}
|
|
1233
1248
|
}, baseFormatProps),
|
|
1234
1249
|
/* eslint-enable */
|
|
1250
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1235
1251
|
setup(props, context) {
|
|
1236
1252
|
const i18n = props.i18n ||
|
|
1237
1253
|
useI18n({ useScope: 'parent', __useComponent: true });
|
|
@@ -1239,7 +1255,7 @@ const NumberFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1239
1255
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1240
1256
|
i18n[NumberPartsSymbol](...args));
|
|
1241
1257
|
}
|
|
1242
|
-
}
|
|
1258
|
+
};
|
|
1243
1259
|
|
|
1244
1260
|
const DATETIME_FORMAT_KEYS = [
|
|
1245
1261
|
'dateStyle',
|
|
@@ -1280,7 +1296,7 @@ const DATETIME_FORMAT_KEYS = [
|
|
|
1280
1296
|
*
|
|
1281
1297
|
* @VueI18nComponent
|
|
1282
1298
|
*/
|
|
1283
|
-
const DatetimeFormat =
|
|
1299
|
+
const DatetimeFormat = /*defineComponent */ {
|
|
1284
1300
|
/* eslint-disable */
|
|
1285
1301
|
name: 'i18n-d',
|
|
1286
1302
|
props: shared.assign({
|
|
@@ -1293,6 +1309,7 @@ const DatetimeFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1293
1309
|
}
|
|
1294
1310
|
}, baseFormatProps),
|
|
1295
1311
|
/* eslint-enable */
|
|
1312
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1296
1313
|
setup(props, context) {
|
|
1297
1314
|
const i18n = props.i18n ||
|
|
1298
1315
|
useI18n({ useScope: 'parent', __useComponent: true });
|
|
@@ -1300,7 +1317,7 @@ const DatetimeFormat = /* #__PURE__*/ vue.defineComponent({
|
|
|
1300
1317
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1301
1318
|
i18n[DatetimePartsSymbol](...args));
|
|
1302
1319
|
}
|
|
1303
|
-
}
|
|
1320
|
+
};
|
|
1304
1321
|
|
|
1305
1322
|
function getComposer$1(i18n, instance) {
|
|
1306
1323
|
const i18nInternal = i18n;
|
|
@@ -1534,10 +1551,8 @@ function createI18n(options = {}, VueI18nLegacy) {
|
|
|
1534
1551
|
// install plugin
|
|
1535
1552
|
async install(app, ...options) {
|
|
1536
1553
|
// setup global provider
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
app.provide(app.__VUE_I18N_SYMBOL__, i18n);
|
|
1540
|
-
}
|
|
1554
|
+
app.__VUE_I18N_SYMBOL__ = symbol;
|
|
1555
|
+
app.provide(app.__VUE_I18N_SYMBOL__, i18n);
|
|
1541
1556
|
// global method and properties injection for Composition API
|
|
1542
1557
|
if (!__legacyMode && __globalInjection) {
|
|
1543
1558
|
injectGlobalFields(app, i18n.global);
|
package/dist/vue-i18n.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type { AllowedComponentProps } from 'vue';
|
|
2
1
|
import type { App } from 'vue';
|
|
3
|
-
import type { ComponentCustomProps } from 'vue';
|
|
4
2
|
import type { ComponentInternalInstance } from 'vue';
|
|
5
|
-
import type { ComponentOptionsMixin } from 'vue';
|
|
6
3
|
import type { ComputedRef } from 'vue';
|
|
7
4
|
import { DateTimeOptions } from '@intlify/core-base';
|
|
8
|
-
import type { DefineComponent } from 'vue';
|
|
9
5
|
import { FallbackLocale } from '@intlify/core-base';
|
|
10
6
|
import type { FallbackLocales } from '@intlify/core-base';
|
|
11
7
|
import { InjectionKey } from 'vue';
|
|
@@ -42,14 +38,11 @@ import { PluralizationRule } from '@intlify/core-base';
|
|
|
42
38
|
import type { PluralizationRules } from '@intlify/core-base';
|
|
43
39
|
import { PostTranslationHandler } from '@intlify/core-base';
|
|
44
40
|
import type { RemoveIndexSignature } from '@intlify/core-base';
|
|
45
|
-
import type { RenderFunction } from 'vue';
|
|
46
41
|
import type { ResourcePath } from '@intlify/core-base';
|
|
47
42
|
import type { ResourceValue } from '@intlify/core-base';
|
|
48
43
|
import type { SchemaParams } from '@intlify/core-base';
|
|
49
44
|
import { TranslateOptions } from '@intlify/core-base';
|
|
50
45
|
import type { VNode } from 'vue';
|
|
51
|
-
import type { VNodeChild } from 'vue';
|
|
52
|
-
import type { VNodeProps } from 'vue';
|
|
53
46
|
import type { WritableComputedRef } from 'vue';
|
|
54
47
|
|
|
55
48
|
/**
|
|
@@ -1312,47 +1305,34 @@ export declare type CustomBlocks<Message = VueMessageType> = Array<CustomBlock<M
|
|
|
1312
1305
|
*
|
|
1313
1306
|
* @VueI18nComponent
|
|
1314
1307
|
*/
|
|
1315
|
-
export declare const DatetimeFormat:
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1308
|
+
export declare const DatetimeFormat: {
|
|
1309
|
+
name: string;
|
|
1310
|
+
props: {
|
|
1311
|
+
value: {
|
|
1312
|
+
type: (NumberConstructor | DateConstructor)[];
|
|
1313
|
+
required: boolean;
|
|
1314
|
+
};
|
|
1315
|
+
format: {
|
|
1316
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
1317
|
+
};
|
|
1318
|
+
} & {
|
|
1319
|
+
tag: {
|
|
1320
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
1321
|
+
};
|
|
1322
|
+
locale: {
|
|
1323
|
+
type: StringConstructor;
|
|
1324
|
+
};
|
|
1325
|
+
scope: {
|
|
1326
|
+
type: StringConstructor;
|
|
1327
|
+
validator: (val: "parent" | "global") => boolean;
|
|
1328
|
+
default: "parent" | "global";
|
|
1329
|
+
};
|
|
1330
|
+
i18n: {
|
|
1331
|
+
type: ObjectConstructor;
|
|
1332
|
+
};
|
|
1319
1333
|
};
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
};
|
|
1323
|
-
} & {
|
|
1324
|
-
tag: {
|
|
1325
|
-
type: (ObjectConstructor | StringConstructor)[];
|
|
1326
|
-
};
|
|
1327
|
-
locale: {
|
|
1328
|
-
type: StringConstructor;
|
|
1329
|
-
};
|
|
1330
|
-
scope: {
|
|
1331
|
-
type: StringConstructor;
|
|
1332
|
-
validator: (val: "parent" | "global") => boolean;
|
|
1333
|
-
default: "parent" | "global";
|
|
1334
|
-
};
|
|
1335
|
-
i18n: {
|
|
1336
|
-
type: ObjectConstructor;
|
|
1337
|
-
};
|
|
1338
|
-
}, RenderFunction, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{
|
|
1339
|
-
value?: unknown;
|
|
1340
|
-
format?: unknown;
|
|
1341
|
-
tag?: unknown;
|
|
1342
|
-
locale?: unknown;
|
|
1343
|
-
scope?: unknown;
|
|
1344
|
-
i18n?: unknown;
|
|
1345
|
-
} & {
|
|
1346
|
-
scope: string;
|
|
1347
|
-
} & {
|
|
1348
|
-
value?: number | Date | undefined;
|
|
1349
|
-
format?: string | Record<string, any> | undefined;
|
|
1350
|
-
tag?: string | Record<string, any> | undefined;
|
|
1351
|
-
locale?: string | undefined;
|
|
1352
|
-
i18n?: Record<string, any> | undefined;
|
|
1353
|
-
}>, {
|
|
1354
|
-
scope: string;
|
|
1355
|
-
}>;
|
|
1334
|
+
setup(props: any, context: any): any;
|
|
1335
|
+
};
|
|
1356
1336
|
|
|
1357
1337
|
/**
|
|
1358
1338
|
* DatetimeFormat Component Props
|
|
@@ -1718,47 +1698,34 @@ export { NamedValue }
|
|
|
1718
1698
|
*
|
|
1719
1699
|
* @VueI18nComponent
|
|
1720
1700
|
*/
|
|
1721
|
-
export declare const NumberFormat:
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1701
|
+
export declare const NumberFormat: {
|
|
1702
|
+
name: string;
|
|
1703
|
+
props: {
|
|
1704
|
+
value: {
|
|
1705
|
+
type: NumberConstructor;
|
|
1706
|
+
required: boolean;
|
|
1707
|
+
};
|
|
1708
|
+
format: {
|
|
1709
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
1710
|
+
};
|
|
1711
|
+
} & {
|
|
1712
|
+
tag: {
|
|
1713
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
1714
|
+
};
|
|
1715
|
+
locale: {
|
|
1716
|
+
type: StringConstructor;
|
|
1717
|
+
};
|
|
1718
|
+
scope: {
|
|
1719
|
+
type: StringConstructor;
|
|
1720
|
+
validator: (val: "parent" | "global") => boolean;
|
|
1721
|
+
default: "parent" | "global";
|
|
1722
|
+
};
|
|
1723
|
+
i18n: {
|
|
1724
|
+
type: ObjectConstructor;
|
|
1725
|
+
};
|
|
1740
1726
|
};
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
};
|
|
1744
|
-
}, RenderFunction, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{
|
|
1745
|
-
value?: unknown;
|
|
1746
|
-
format?: unknown;
|
|
1747
|
-
tag?: unknown;
|
|
1748
|
-
locale?: unknown;
|
|
1749
|
-
scope?: unknown;
|
|
1750
|
-
i18n?: unknown;
|
|
1751
|
-
} & {
|
|
1752
|
-
scope: string;
|
|
1753
|
-
} & {
|
|
1754
|
-
value?: number | undefined;
|
|
1755
|
-
format?: string | Record<string, any> | undefined;
|
|
1756
|
-
tag?: string | Record<string, any> | undefined;
|
|
1757
|
-
locale?: string | undefined;
|
|
1758
|
-
i18n?: Record<string, any> | undefined;
|
|
1759
|
-
}>, {
|
|
1760
|
-
scope: string;
|
|
1761
|
-
}>;
|
|
1727
|
+
setup(props: any, context: any): any;
|
|
1728
|
+
};
|
|
1762
1729
|
|
|
1763
1730
|
/**
|
|
1764
1731
|
* NumberFormat Component Props
|
|
@@ -1839,48 +1806,35 @@ export declare type TranslateResult = string;
|
|
|
1839
1806
|
*
|
|
1840
1807
|
* @VueI18nComponent
|
|
1841
1808
|
*/
|
|
1842
|
-
export declare const Translation:
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1809
|
+
export declare const Translation: {
|
|
1810
|
+
name: string;
|
|
1811
|
+
props: {
|
|
1812
|
+
keypath: {
|
|
1813
|
+
type: StringConstructor;
|
|
1814
|
+
required: boolean;
|
|
1815
|
+
};
|
|
1816
|
+
plural: {
|
|
1817
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
1818
|
+
validator: (val: any) => boolean;
|
|
1819
|
+
};
|
|
1820
|
+
} & {
|
|
1821
|
+
tag: {
|
|
1822
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
1823
|
+
};
|
|
1824
|
+
locale: {
|
|
1825
|
+
type: StringConstructor;
|
|
1826
|
+
};
|
|
1827
|
+
scope: {
|
|
1828
|
+
type: StringConstructor;
|
|
1829
|
+
validator: (val: "parent" | "global") => boolean;
|
|
1830
|
+
default: "parent" | "global";
|
|
1831
|
+
};
|
|
1832
|
+
i18n: {
|
|
1833
|
+
type: ObjectConstructor;
|
|
1834
|
+
};
|
|
1854
1835
|
};
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
};
|
|
1858
|
-
scope: {
|
|
1859
|
-
type: StringConstructor;
|
|
1860
|
-
validator: (val: "parent" | "global") => boolean;
|
|
1861
|
-
default: "parent" | "global";
|
|
1862
|
-
};
|
|
1863
|
-
i18n: {
|
|
1864
|
-
type: ObjectConstructor;
|
|
1865
|
-
};
|
|
1866
|
-
}, () => VNodeChild, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{
|
|
1867
|
-
keypath?: unknown;
|
|
1868
|
-
plural?: unknown;
|
|
1869
|
-
tag?: unknown;
|
|
1870
|
-
locale?: unknown;
|
|
1871
|
-
scope?: unknown;
|
|
1872
|
-
i18n?: unknown;
|
|
1873
|
-
} & {
|
|
1874
|
-
scope: string;
|
|
1875
|
-
} & {
|
|
1876
|
-
keypath?: string | undefined;
|
|
1877
|
-
plural?: string | number | undefined;
|
|
1878
|
-
tag?: string | Record<string, any> | undefined;
|
|
1879
|
-
locale?: string | undefined;
|
|
1880
|
-
i18n?: Record<string, any> | undefined;
|
|
1881
|
-
}>, {
|
|
1882
|
-
scope: string;
|
|
1883
|
-
}>;
|
|
1836
|
+
setup(props: any, context: any): any;
|
|
1837
|
+
};
|
|
1884
1838
|
|
|
1885
1839
|
/**
|
|
1886
1840
|
* Translation Directive (`v-t`)
|