yc-design-vue 1.7.9 → 1.8.1
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/es/Calendar/Calendar.vue.js +15 -14
- package/es/Calendar/CalendarMonth.vue.d.ts +1 -1
- package/es/Calendar/CalendarMonth.vue.js +11 -1
- package/es/Calendar/CalendarYear.vue.js +20 -16
- package/es/ColorPicker/ColorList.vue.js +4 -2
- package/es/ColorPicker/ColorPanel.vue.js +6 -4
- package/es/ConfigProvider/index.d.ts +3 -0
- package/es/ConfigProvider/index.vue.d.ts +1 -0
- package/es/ConfigProvider/index.vue.js +13 -2
- package/es/ConfigProvider/type.d.ts +1 -0
- package/es/Drawer/Drawer.vue.js +6 -4
- package/es/Drawer/DrawerService.vue.js +2 -2
- package/es/Empty/index.vue.js +11 -4
- package/es/Image/Image.vue.js +4 -2
- package/es/Image/ImagePreviewToolbar.vue.js +13 -29
- package/es/Input/InputSuffix.vue.js +2 -2
- package/es/Layout/hooks/useTheme.js +0 -1
- package/es/Modal/Modal.vue.js +6 -4
- package/es/Modal/ModalService.vue.js +2 -2
- package/es/Pagination/Pagination.vue.js +5 -3
- package/es/Pagination/hooks/useContext.d.ts +5 -0
- package/es/Pagination/hooks/useContext.js +5 -2
- package/es/Popconfirm/index.vue.js +6 -4
- package/es/Typography/TypographyBase.vue.js +5 -4
- package/es/Watermark/index.d.ts +3 -3
- package/es/Watermark/index.vue.d.ts +1 -1
- package/es/_shared/icons/IconEyeClose.vue.js +21 -1
- package/es/_shared/icons/IconEyeClose.vue2.js +1 -21
- package/es/_shared/icons/IconEyeOpen.vue.js +18 -1
- package/es/_shared/icons/IconEyeOpen.vue2.js +1 -18
- package/es/_shared/locale/i18n.d.ts +256 -0
- package/es/_shared/locale/i18n.js +40 -0
- package/es/_shared/locale/lang/ar-eg.d.ts +205 -0
- package/es/_shared/locale/lang/ar-eg.js +153 -0
- package/es/_shared/locale/lang/de-de.d.ts +205 -0
- package/es/_shared/locale/lang/de-de.js +153 -0
- package/es/_shared/locale/lang/en-us.d.ts +253 -0
- package/es/_shared/locale/lang/en-us.js +158 -0
- package/es/_shared/locale/lang/es-es.d.ts +205 -0
- package/es/_shared/locale/lang/es-es.js +153 -0
- package/es/_shared/locale/lang/fr-fr.d.ts +205 -0
- package/es/_shared/locale/lang/fr-fr.js +153 -0
- package/es/_shared/locale/lang/id-id.d.ts +205 -0
- package/es/_shared/locale/lang/id-id.js +153 -0
- package/es/_shared/locale/lang/it-it.d.ts +205 -0
- package/es/_shared/locale/lang/it-it.js +153 -0
- package/es/_shared/locale/lang/ja-jp.d.ts +253 -0
- package/es/_shared/locale/lang/ja-jp.js +201 -0
- package/es/_shared/locale/lang/km-kh.d.ts +205 -0
- package/es/_shared/locale/lang/km-kh.js +153 -0
- package/es/_shared/locale/lang/ko-kr.d.ts +205 -0
- package/es/_shared/locale/lang/ko-kr.js +153 -0
- package/es/_shared/locale/lang/ms-my.d.ts +205 -0
- package/es/_shared/locale/lang/ms-my.js +153 -0
- package/es/_shared/locale/lang/nl-nl.d.ts +253 -0
- package/es/_shared/locale/lang/nl-nl.js +201 -0
- package/es/_shared/locale/lang/pt-pt.d.ts +205 -0
- package/es/_shared/locale/lang/pt-pt.js +153 -0
- package/es/_shared/locale/lang/ru-ru.d.ts +253 -0
- package/es/_shared/locale/lang/ru-ru.js +201 -0
- package/es/_shared/locale/lang/th-th.d.ts +205 -0
- package/es/_shared/locale/lang/th-th.js +153 -0
- package/es/_shared/locale/lang/vi-vn.d.ts +205 -0
- package/es/_shared/locale/lang/vi-vn.js +153 -0
- package/es/_shared/locale/lang/zh-cn.d.ts +253 -0
- package/es/_shared/locale/lang/zh-cn.js +201 -0
- package/es/_shared/locale/lang/zh-tw.d.ts +253 -0
- package/es/_shared/locale/lang/zh-tw.js +201 -0
- package/es/_shared/utils/time.js +1 -1
- package/es/index.js +2 -0
- package/es/node_modules/@intlify/core-base/dist/core-base.js +1129 -0
- package/es/node_modules/@intlify/message-compiler/dist/message-compiler.js +65 -0
- package/es/node_modules/@intlify/shared/dist/shared.js +199 -0
- package/es/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +1381 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/const.js +6 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/env.js +12 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/index.js +26 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/proxy.js +103 -0
- package/es/node_modules/@vue/devtools-api/lib/esm/time.js +25 -0
- package/es/node_modules/b-validate/es/is.js +27 -0
- package/es/node_modules/b-validate/es/locale/en-US.js +50 -0
- package/es/node_modules/b-validate/es/rules/base.js +86 -0
- package/es/node_modules/b-validate/es/util.js +25 -0
- package/lib/Calendar/Calendar.vue.js +1 -1
- package/lib/Calendar/CalendarMonth.vue.d.ts +1 -1
- package/lib/Calendar/CalendarMonth.vue.js +1 -1
- package/lib/Calendar/CalendarYear.vue.js +1 -1
- package/lib/ColorPicker/ColorList.vue.js +1 -1
- package/lib/ColorPicker/ColorPanel.vue.js +1 -1
- package/lib/ConfigProvider/index.d.ts +3 -0
- package/lib/ConfigProvider/index.vue.d.ts +1 -0
- package/lib/ConfigProvider/index.vue.js +1 -1
- package/lib/ConfigProvider/type.d.ts +1 -0
- package/lib/Drawer/Drawer.vue.js +1 -1
- package/lib/Drawer/DrawerService.vue.js +1 -1
- package/lib/Empty/index.vue.js +1 -1
- package/lib/Image/Image.vue.js +1 -1
- package/lib/Image/ImagePreviewToolbar.vue.js +1 -1
- package/lib/Input/InputSuffix.vue.js +1 -1
- package/lib/Modal/Modal.vue.js +1 -1
- package/lib/Modal/ModalService.vue.js +1 -1
- package/lib/Pagination/Pagination.vue.js +1 -1
- package/lib/Pagination/hooks/useContext.d.ts +5 -0
- package/lib/Pagination/hooks/useContext.js +1 -1
- package/lib/Popconfirm/index.vue.js +1 -1
- package/lib/Typography/TypographyBase.vue.js +1 -1
- package/lib/Watermark/index.d.ts +3 -3
- package/lib/Watermark/index.vue.d.ts +1 -1
- package/lib/_shared/icons/IconEyeClose.vue.js +1 -1
- package/lib/_shared/icons/IconEyeClose.vue2.js +1 -1
- package/lib/_shared/icons/IconEyeOpen.vue.js +1 -1
- package/lib/_shared/icons/IconEyeOpen.vue2.js +1 -1
- package/lib/_shared/locale/i18n.d.ts +256 -0
- package/lib/_shared/locale/i18n.js +1 -0
- package/lib/_shared/locale/lang/ar-eg.d.ts +205 -0
- package/lib/_shared/locale/lang/ar-eg.js +1 -0
- package/lib/_shared/locale/lang/de-de.d.ts +205 -0
- package/lib/_shared/locale/lang/de-de.js +1 -0
- package/lib/_shared/locale/lang/en-us.d.ts +253 -0
- package/lib/_shared/locale/lang/en-us.js +1 -0
- package/lib/_shared/locale/lang/es-es.d.ts +205 -0
- package/lib/_shared/locale/lang/es-es.js +1 -0
- package/lib/_shared/locale/lang/fr-fr.d.ts +205 -0
- package/lib/_shared/locale/lang/fr-fr.js +1 -0
- package/lib/_shared/locale/lang/id-id.d.ts +205 -0
- package/lib/_shared/locale/lang/id-id.js +1 -0
- package/lib/_shared/locale/lang/it-it.d.ts +205 -0
- package/lib/_shared/locale/lang/it-it.js +1 -0
- package/lib/_shared/locale/lang/ja-jp.d.ts +253 -0
- package/lib/_shared/locale/lang/ja-jp.js +1 -0
- package/lib/_shared/locale/lang/km-kh.d.ts +205 -0
- package/lib/_shared/locale/lang/km-kh.js +1 -0
- package/lib/_shared/locale/lang/ko-kr.d.ts +205 -0
- package/lib/_shared/locale/lang/ko-kr.js +1 -0
- package/lib/_shared/locale/lang/ms-my.d.ts +205 -0
- package/lib/_shared/locale/lang/ms-my.js +1 -0
- package/lib/_shared/locale/lang/nl-nl.d.ts +253 -0
- package/lib/_shared/locale/lang/nl-nl.js +1 -0
- package/lib/_shared/locale/lang/pt-pt.d.ts +205 -0
- package/lib/_shared/locale/lang/pt-pt.js +1 -0
- package/lib/_shared/locale/lang/ru-ru.d.ts +253 -0
- package/lib/_shared/locale/lang/ru-ru.js +1 -0
- package/lib/_shared/locale/lang/th-th.d.ts +205 -0
- package/lib/_shared/locale/lang/th-th.js +1 -0
- package/lib/_shared/locale/lang/vi-vn.d.ts +205 -0
- package/lib/_shared/locale/lang/vi-vn.js +1 -0
- package/lib/_shared/locale/lang/zh-cn.d.ts +253 -0
- package/lib/_shared/locale/lang/zh-cn.js +1 -0
- package/lib/_shared/locale/lang/zh-tw.d.ts +253 -0
- package/lib/_shared/locale/lang/zh-tw.js +1 -0
- package/lib/_shared/utils/time.js +1 -1
- package/lib/index.js +1 -1
- package/lib/node_modules/@intlify/core-base/dist/core-base.js +1 -0
- package/lib/node_modules/@intlify/message-compiler/dist/message-compiler.js +6 -0
- package/lib/node_modules/@intlify/shared/dist/shared.js +7 -0
- package/lib/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/const.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/env.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/index.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/proxy.js +1 -0
- package/lib/node_modules/@vue/devtools-api/lib/esm/time.js +1 -0
- package/lib/node_modules/b-validate/es/is.js +1 -0
- package/lib/node_modules/b-validate/es/locale/en-US.js +1 -0
- package/lib/node_modules/b-validate/es/rules/base.js +1 -0
- package/lib/node_modules/b-validate/es/util.js +1 -0
- package/package.json +3 -2
@@ -0,0 +1,1129 @@
|
|
1
|
+
import { isFunction, warn, isString, isArray, isPlainObject, create, assign, isBoolean, isRegExp, warnOnce, isObject, hasOwn, format, getGlobalThis, isNumber, isEmptyObject, isDate, escapeHtml, inBrowser, mark, measure, join, toDisplayString, isPromise, generateFormatCacheKey, generateCodeFrame } from "../../shared/dist/shared.js";
|
2
|
+
import { createCompileError, COMPILE_ERROR_CODES_EXTEND_POINT } from "../../message-compiler/dist/message-compiler.js";
|
3
|
+
/*!
|
4
|
+
* core-base v12.0.0-alpha.3
|
5
|
+
* (c) 2016-present kazuya kawaguchi and contributors
|
6
|
+
* Released under the MIT License.
|
7
|
+
*/
|
8
|
+
function initFeatureFlags() {
|
9
|
+
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
|
10
|
+
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
11
|
+
}
|
12
|
+
if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== "boolean") {
|
13
|
+
getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
function isMessageAST(val) {
|
17
|
+
return isObject(val) && resolveType(val) === 0 && (hasOwn(val, "b") || hasOwn(val, "body"));
|
18
|
+
}
|
19
|
+
const PROPS_BODY = ["b", "body"];
|
20
|
+
const PROPS_CASES = ["c", "cases"];
|
21
|
+
const PROPS_STATIC = ["s", "static"];
|
22
|
+
const PROPS_ITEMS = ["i", "items"];
|
23
|
+
const PROPS_TYPE = ["t", "type"];
|
24
|
+
function resolveType(node) {
|
25
|
+
return resolveProps(node, PROPS_TYPE);
|
26
|
+
}
|
27
|
+
const PROPS_VALUE = ["v", "value"];
|
28
|
+
const PROPS_MODIFIER = ["m", "modifier"];
|
29
|
+
const PROPS_KEY = ["k", "key"];
|
30
|
+
function resolveProps(node, props, defaultValue) {
|
31
|
+
for (let i = 0; i < props.length; i++) {
|
32
|
+
const prop = props[i];
|
33
|
+
if (hasOwn(node, prop) && node[prop] != null) {
|
34
|
+
return node[prop];
|
35
|
+
}
|
36
|
+
}
|
37
|
+
return defaultValue;
|
38
|
+
}
|
39
|
+
const AST_NODE_PROPS_KEYS = [
|
40
|
+
...PROPS_BODY,
|
41
|
+
...PROPS_CASES,
|
42
|
+
...PROPS_STATIC,
|
43
|
+
...PROPS_ITEMS,
|
44
|
+
...PROPS_KEY,
|
45
|
+
...PROPS_MODIFIER,
|
46
|
+
...PROPS_VALUE,
|
47
|
+
...PROPS_TYPE
|
48
|
+
];
|
49
|
+
let devtools = null;
|
50
|
+
function setDevToolsHook(hook) {
|
51
|
+
devtools = hook;
|
52
|
+
}
|
53
|
+
function initI18nDevTools(i18n, version, meta) {
|
54
|
+
devtools && devtools.emit("i18n:init", {
|
55
|
+
timestamp: Date.now(),
|
56
|
+
i18n,
|
57
|
+
version,
|
58
|
+
meta
|
59
|
+
});
|
60
|
+
}
|
61
|
+
const translateDevTools = /* @__PURE__ */ createDevToolsHook("function:translate");
|
62
|
+
function createDevToolsHook(hook) {
|
63
|
+
return (payloads) => devtools && devtools.emit(hook, payloads);
|
64
|
+
}
|
65
|
+
const CoreErrorCodes = {
|
66
|
+
INVALID_ARGUMENT: COMPILE_ERROR_CODES_EXTEND_POINT,
|
67
|
+
// 17
|
68
|
+
INVALID_DATE_ARGUMENT: 18,
|
69
|
+
INVALID_ISO_DATE_ARGUMENT: 19,
|
70
|
+
NOT_SUPPORT_NON_STRING_MESSAGE: 20,
|
71
|
+
NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
|
72
|
+
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
|
73
|
+
NOT_SUPPORT_LOCALE_TYPE: 23
|
74
|
+
};
|
75
|
+
const CORE_ERROR_CODES_EXTEND_POINT = 24;
|
76
|
+
function createCoreError(code) {
|
77
|
+
return createCompileError(code, null, process.env.NODE_ENV !== "production" ? { messages: errorMessages } : void 0);
|
78
|
+
}
|
79
|
+
const errorMessages = {
|
80
|
+
[CoreErrorCodes.INVALID_ARGUMENT]: "Invalid arguments",
|
81
|
+
[CoreErrorCodes.INVALID_DATE_ARGUMENT]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
|
82
|
+
[CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string",
|
83
|
+
[CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message",
|
84
|
+
[CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: "cannot support promise value",
|
85
|
+
[CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: "cannot support async function",
|
86
|
+
[CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE]: "cannot support locale type"
|
87
|
+
};
|
88
|
+
function getLocale(context, options) {
|
89
|
+
return options.locale != null ? resolveLocale(options.locale) : resolveLocale(context.locale);
|
90
|
+
}
|
91
|
+
let _resolveLocale;
|
92
|
+
function resolveLocale(locale) {
|
93
|
+
if (isString(locale)) {
|
94
|
+
return locale;
|
95
|
+
} else {
|
96
|
+
if (isFunction(locale)) {
|
97
|
+
if (locale.resolvedOnce && _resolveLocale != null) {
|
98
|
+
return _resolveLocale;
|
99
|
+
} else if (locale.constructor.name === "Function") {
|
100
|
+
const resolve = locale();
|
101
|
+
if (isPromise(resolve)) {
|
102
|
+
throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
|
103
|
+
}
|
104
|
+
return _resolveLocale = resolve;
|
105
|
+
} else {
|
106
|
+
throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
|
107
|
+
}
|
108
|
+
} else {
|
109
|
+
throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
113
|
+
function fallbackWithSimple(ctx, fallback, start) {
|
114
|
+
return [.../* @__PURE__ */ new Set([
|
115
|
+
start,
|
116
|
+
...isArray(fallback) ? fallback : isObject(fallback) ? Object.keys(fallback) : isString(fallback) ? [fallback] : [start]
|
117
|
+
])];
|
118
|
+
}
|
119
|
+
function fallbackWithLocaleChain(ctx, fallback, start) {
|
120
|
+
const startLocale = isString(start) ? start : DEFAULT_LOCALE;
|
121
|
+
const context = ctx;
|
122
|
+
if (!context.__localeChainCache) {
|
123
|
+
context.__localeChainCache = /* @__PURE__ */ new Map();
|
124
|
+
}
|
125
|
+
let chain = context.__localeChainCache.get(startLocale);
|
126
|
+
if (!chain) {
|
127
|
+
chain = [];
|
128
|
+
let block = [start];
|
129
|
+
while (isArray(block)) {
|
130
|
+
block = appendBlockToChain(chain, block, fallback);
|
131
|
+
}
|
132
|
+
const defaults = isArray(fallback) || !isPlainObject(fallback) ? fallback : fallback["default"] ? fallback["default"] : null;
|
133
|
+
block = isString(defaults) ? [defaults] : defaults;
|
134
|
+
if (isArray(block)) {
|
135
|
+
appendBlockToChain(chain, block, false);
|
136
|
+
}
|
137
|
+
context.__localeChainCache.set(startLocale, chain);
|
138
|
+
}
|
139
|
+
return chain;
|
140
|
+
}
|
141
|
+
function appendBlockToChain(chain, block, blocks) {
|
142
|
+
let follow = true;
|
143
|
+
for (let i = 0; i < block.length && isBoolean(follow); i++) {
|
144
|
+
const locale = block[i];
|
145
|
+
if (isString(locale)) {
|
146
|
+
follow = appendLocaleToChain(chain, block[i], blocks);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
return follow;
|
150
|
+
}
|
151
|
+
function appendLocaleToChain(chain, locale, blocks) {
|
152
|
+
let follow;
|
153
|
+
const tokens = locale.split("-");
|
154
|
+
do {
|
155
|
+
const target = tokens.join("-");
|
156
|
+
follow = appendItemToChain(chain, target, blocks);
|
157
|
+
tokens.splice(-1, 1);
|
158
|
+
} while (tokens.length && follow === true);
|
159
|
+
return follow;
|
160
|
+
}
|
161
|
+
function appendItemToChain(chain, target, blocks) {
|
162
|
+
let follow = false;
|
163
|
+
if (!chain.includes(target)) {
|
164
|
+
follow = true;
|
165
|
+
if (target) {
|
166
|
+
follow = target[target.length - 1] !== "!";
|
167
|
+
const locale = target.replace(/!/g, "");
|
168
|
+
chain.push(locale);
|
169
|
+
if ((isArray(blocks) || isPlainObject(blocks)) && blocks[locale]) {
|
170
|
+
follow = blocks[locale];
|
171
|
+
}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
return follow;
|
175
|
+
}
|
176
|
+
function resolveWithKeyValue(obj, path) {
|
177
|
+
return isObject(obj) ? obj[path] : null;
|
178
|
+
}
|
179
|
+
const CoreWarnCodes = {
|
180
|
+
NOT_FOUND_KEY: 1,
|
181
|
+
FALLBACK_TO_TRANSLATE: 2,
|
182
|
+
CANNOT_FORMAT_NUMBER: 3,
|
183
|
+
FALLBACK_TO_NUMBER_FORMAT: 4,
|
184
|
+
CANNOT_FORMAT_DATE: 5,
|
185
|
+
FALLBACK_TO_DATE_FORMAT: 6,
|
186
|
+
EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7
|
187
|
+
};
|
188
|
+
const CORE_WARN_CODES_EXTEND_POINT = 8;
|
189
|
+
const warnMessages = {
|
190
|
+
[CoreWarnCodes.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale messages.`,
|
191
|
+
[CoreWarnCodes.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
|
192
|
+
[CoreWarnCodes.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
|
193
|
+
[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
|
194
|
+
[CoreWarnCodes.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
|
195
|
+
[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
|
196
|
+
[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.`
|
197
|
+
};
|
198
|
+
function getWarnMessage(code, ...args) {
|
199
|
+
return format(warnMessages[code], ...args);
|
200
|
+
}
|
201
|
+
const VERSION = "12.0.0-alpha.3";
|
202
|
+
const NOT_RESOLVED = -1;
|
203
|
+
const DEFAULT_LOCALE = "en-US";
|
204
|
+
const MISSING_RESOLVE_VALUE = "";
|
205
|
+
const capitalize = (str) => `${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`;
|
206
|
+
function getDefaultLinkedModifiers() {
|
207
|
+
return {
|
208
|
+
upper: (val, type) => {
|
209
|
+
return type === "text" && isString(val) ? val.toUpperCase() : type === "vnode" && isObject(val) && "__v_isVNode" in val ? val.children.toUpperCase() : val;
|
210
|
+
},
|
211
|
+
lower: (val, type) => {
|
212
|
+
return type === "text" && isString(val) ? val.toLowerCase() : type === "vnode" && isObject(val) && "__v_isVNode" in val ? val.children.toLowerCase() : val;
|
213
|
+
},
|
214
|
+
capitalize: (val, type) => {
|
215
|
+
return type === "text" && isString(val) ? capitalize(val) : type === "vnode" && isObject(val) && "__v_isVNode" in val ? capitalize(val.children) : val;
|
216
|
+
}
|
217
|
+
};
|
218
|
+
}
|
219
|
+
let _compiler;
|
220
|
+
let _additionalMeta = null;
|
221
|
+
const setAdditionalMeta = /* @__NO_SIDE_EFFECTS__ */ (meta) => {
|
222
|
+
_additionalMeta = meta;
|
223
|
+
};
|
224
|
+
const getAdditionalMeta = /* @__NO_SIDE_EFFECTS__ */ () => _additionalMeta;
|
225
|
+
let _fallbackContext = null;
|
226
|
+
const setFallbackContext = (context) => {
|
227
|
+
_fallbackContext = context;
|
228
|
+
};
|
229
|
+
const getFallbackContext = () => _fallbackContext;
|
230
|
+
let _cid = 0;
|
231
|
+
function createCoreContext(options = {}) {
|
232
|
+
const onWarn = isFunction(options.onWarn) ? options.onWarn : warn;
|
233
|
+
const version = isString(options.version) ? options.version : VERSION;
|
234
|
+
const locale = isString(options.locale) || isFunction(options.locale) ? options.locale : DEFAULT_LOCALE;
|
235
|
+
const _locale = isFunction(locale) ? DEFAULT_LOCALE : locale;
|
236
|
+
const fallbackLocale = isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || isString(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale;
|
237
|
+
const messages = isPlainObject(options.messages) ? options.messages : createResources(_locale);
|
238
|
+
const datetimeFormats = isPlainObject(options.datetimeFormats) ? options.datetimeFormats : createResources(_locale);
|
239
|
+
const numberFormats = isPlainObject(options.numberFormats) ? options.numberFormats : createResources(_locale);
|
240
|
+
const modifiers = assign(create(), options.modifiers, getDefaultLinkedModifiers());
|
241
|
+
const pluralRules = options.pluralRules || create();
|
242
|
+
const missing = isFunction(options.missing) ? options.missing : null;
|
243
|
+
const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
|
244
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
|
245
|
+
const fallbackFormat = !!options.fallbackFormat;
|
246
|
+
const unresolving = !!options.unresolving;
|
247
|
+
const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
|
248
|
+
const processor = isPlainObject(options.processor) ? options.processor : null;
|
249
|
+
const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
|
250
|
+
const escapeParameter = !!options.escapeParameter;
|
251
|
+
const messageCompiler = isFunction(options.messageCompiler) ? options.messageCompiler : _compiler;
|
252
|
+
if (process.env.NODE_ENV !== "production" && true && true && isFunction(options.messageCompiler)) {
|
253
|
+
warnOnce(getWarnMessage(CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
|
254
|
+
}
|
255
|
+
const messageResolver = isFunction(options.messageResolver) ? options.messageResolver : resolveWithKeyValue;
|
256
|
+
const localeFallbacker = isFunction(options.localeFallbacker) ? options.localeFallbacker : fallbackWithSimple;
|
257
|
+
const fallbackContext = isObject(options.fallbackContext) ? options.fallbackContext : void 0;
|
258
|
+
const internalOptions = options;
|
259
|
+
const __datetimeFormatters = isObject(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
|
260
|
+
const __numberFormatters = isObject(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
|
261
|
+
const __meta = isObject(internalOptions.__meta) ? internalOptions.__meta : {};
|
262
|
+
_cid++;
|
263
|
+
const context = {
|
264
|
+
version,
|
265
|
+
cid: _cid,
|
266
|
+
locale,
|
267
|
+
fallbackLocale,
|
268
|
+
messages,
|
269
|
+
modifiers,
|
270
|
+
pluralRules,
|
271
|
+
missing,
|
272
|
+
missingWarn,
|
273
|
+
fallbackWarn,
|
274
|
+
fallbackFormat,
|
275
|
+
unresolving,
|
276
|
+
postTranslation,
|
277
|
+
processor,
|
278
|
+
warnHtmlMessage,
|
279
|
+
escapeParameter,
|
280
|
+
messageCompiler,
|
281
|
+
messageResolver,
|
282
|
+
localeFallbacker,
|
283
|
+
fallbackContext,
|
284
|
+
onWarn,
|
285
|
+
__meta
|
286
|
+
};
|
287
|
+
{
|
288
|
+
context.datetimeFormats = datetimeFormats;
|
289
|
+
context.numberFormats = numberFormats;
|
290
|
+
context.__datetimeFormatters = __datetimeFormatters;
|
291
|
+
context.__numberFormatters = __numberFormatters;
|
292
|
+
}
|
293
|
+
if (process.env.NODE_ENV !== "production") {
|
294
|
+
context.__v_emitter = internalOptions.__v_emitter != null ? internalOptions.__v_emitter : void 0;
|
295
|
+
}
|
296
|
+
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
297
|
+
initI18nDevTools(context, version, __meta);
|
298
|
+
}
|
299
|
+
return context;
|
300
|
+
}
|
301
|
+
const createResources = (locale) => ({ [locale]: create() });
|
302
|
+
function isTranslateFallbackWarn(fallback, key) {
|
303
|
+
return fallback instanceof RegExp ? fallback.test(key) : fallback;
|
304
|
+
}
|
305
|
+
function isTranslateMissingWarn(missing, key) {
|
306
|
+
return missing instanceof RegExp ? missing.test(key) : missing;
|
307
|
+
}
|
308
|
+
function handleMissing(context, key, locale, missingWarn, type) {
|
309
|
+
const { missing, onWarn } = context;
|
310
|
+
if (process.env.NODE_ENV !== "production") {
|
311
|
+
const emitter = context.__v_emitter;
|
312
|
+
if (emitter) {
|
313
|
+
emitter.emit("missing", {
|
314
|
+
locale,
|
315
|
+
key,
|
316
|
+
type,
|
317
|
+
groupId: `${type}:${key}`
|
318
|
+
});
|
319
|
+
}
|
320
|
+
}
|
321
|
+
if (missing !== null) {
|
322
|
+
const ret = missing(context, locale, key, type);
|
323
|
+
return isString(ret) ? ret : key;
|
324
|
+
} else {
|
325
|
+
if (process.env.NODE_ENV !== "production" && isTranslateMissingWarn(missingWarn, key)) {
|
326
|
+
onWarn(getWarnMessage(CoreWarnCodes.NOT_FOUND_KEY, { key, locale }));
|
327
|
+
}
|
328
|
+
return key;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
function updateFallbackLocale(ctx, locale, fallback) {
|
332
|
+
const context = ctx;
|
333
|
+
context.__localeChainCache = /* @__PURE__ */ new Map();
|
334
|
+
ctx.localeFallbacker(ctx, fallback, locale);
|
335
|
+
}
|
336
|
+
function isAlmostSameLocale(locale, compareLocale) {
|
337
|
+
if (locale === compareLocale)
|
338
|
+
return false;
|
339
|
+
return locale.split("-")[0] === compareLocale.split("-")[0];
|
340
|
+
}
|
341
|
+
function isImplicitFallback(targetLocale, locales) {
|
342
|
+
const index = locales.indexOf(targetLocale);
|
343
|
+
if (index === -1) {
|
344
|
+
return false;
|
345
|
+
}
|
346
|
+
for (let i = index + 1; i < locales.length; i++) {
|
347
|
+
if (isAlmostSameLocale(targetLocale, locales[i])) {
|
348
|
+
return true;
|
349
|
+
}
|
350
|
+
}
|
351
|
+
return false;
|
352
|
+
}
|
353
|
+
const intlDefined = typeof Intl !== "undefined";
|
354
|
+
const Availabilities = {
|
355
|
+
dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== "undefined",
|
356
|
+
numberFormat: intlDefined && typeof Intl.NumberFormat !== "undefined"
|
357
|
+
};
|
358
|
+
function datetime(context, ...args) {
|
359
|
+
const { datetimeFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
|
360
|
+
const { __datetimeFormatters } = context;
|
361
|
+
if (process.env.NODE_ENV !== "production" && !Availabilities.dateTimeFormat) {
|
362
|
+
onWarn(getWarnMessage(CoreWarnCodes.CANNOT_FORMAT_DATE));
|
363
|
+
return MISSING_RESOLVE_VALUE;
|
364
|
+
}
|
365
|
+
const [key, value, options, overrides] = parseDateTimeArgs(...args);
|
366
|
+
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
|
367
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
|
368
|
+
const part = !!options.part;
|
369
|
+
const locale = getLocale(context, options);
|
370
|
+
const locales = localeFallbacker(
|
371
|
+
context,
|
372
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
373
|
+
fallbackLocale,
|
374
|
+
locale
|
375
|
+
);
|
376
|
+
if (!isString(key) || key === "") {
|
377
|
+
return new Intl.DateTimeFormat(locale, overrides).format(value);
|
378
|
+
}
|
379
|
+
let datetimeFormat = {};
|
380
|
+
let targetLocale;
|
381
|
+
let format2 = null;
|
382
|
+
let from = locale;
|
383
|
+
let to = null;
|
384
|
+
const type = "datetime format";
|
385
|
+
for (let i = 0; i < locales.length; i++) {
|
386
|
+
targetLocale = to = locales[i];
|
387
|
+
if (process.env.NODE_ENV !== "production" && locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
|
388
|
+
onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_DATE_FORMAT, {
|
389
|
+
key,
|
390
|
+
target: targetLocale
|
391
|
+
}));
|
392
|
+
}
|
393
|
+
if (process.env.NODE_ENV !== "production" && locale !== targetLocale) {
|
394
|
+
const emitter = context.__v_emitter;
|
395
|
+
if (emitter) {
|
396
|
+
emitter.emit("fallback", {
|
397
|
+
type,
|
398
|
+
key,
|
399
|
+
from,
|
400
|
+
to,
|
401
|
+
groupId: `${type}:${key}`
|
402
|
+
});
|
403
|
+
}
|
404
|
+
}
|
405
|
+
datetimeFormat = datetimeFormats[targetLocale] || {};
|
406
|
+
format2 = datetimeFormat[key];
|
407
|
+
if (isPlainObject(format2))
|
408
|
+
break;
|
409
|
+
handleMissing(context, key, targetLocale, missingWarn, type);
|
410
|
+
from = to;
|
411
|
+
}
|
412
|
+
if (!isPlainObject(format2) || !isString(targetLocale)) {
|
413
|
+
return unresolving ? NOT_RESOLVED : key;
|
414
|
+
}
|
415
|
+
let id = `${targetLocale}__${key}`;
|
416
|
+
if (!isEmptyObject(overrides)) {
|
417
|
+
id = `${id}__${JSON.stringify(overrides)}`;
|
418
|
+
}
|
419
|
+
let formatter = __datetimeFormatters.get(id);
|
420
|
+
if (!formatter) {
|
421
|
+
formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format2, overrides));
|
422
|
+
__datetimeFormatters.set(id, formatter);
|
423
|
+
}
|
424
|
+
return !part ? formatter.format(value) : formatter.formatToParts(value);
|
425
|
+
}
|
426
|
+
const DATETIME_FORMAT_OPTIONS_KEYS = [
|
427
|
+
"localeMatcher",
|
428
|
+
"weekday",
|
429
|
+
"era",
|
430
|
+
"year",
|
431
|
+
"month",
|
432
|
+
"day",
|
433
|
+
"hour",
|
434
|
+
"minute",
|
435
|
+
"second",
|
436
|
+
"timeZoneName",
|
437
|
+
"formatMatcher",
|
438
|
+
"hour12",
|
439
|
+
"timeZone",
|
440
|
+
"dateStyle",
|
441
|
+
"timeStyle",
|
442
|
+
"calendar",
|
443
|
+
"dayPeriod",
|
444
|
+
"numberingSystem",
|
445
|
+
"hourCycle",
|
446
|
+
"fractionalSecondDigits"
|
447
|
+
];
|
448
|
+
function parseDateTimeArgs(...args) {
|
449
|
+
const [arg1, arg2, arg3, arg4] = args;
|
450
|
+
const options = create();
|
451
|
+
let overrides = create();
|
452
|
+
let value;
|
453
|
+
if (isString(arg1)) {
|
454
|
+
const matches = arg1.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
|
455
|
+
if (!matches) {
|
456
|
+
throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
|
457
|
+
}
|
458
|
+
const dateTime = matches[3] ? matches[3].trim().startsWith("T") ? `${matches[1].trim()}${matches[3].trim()}` : `${matches[1].trim()}T${matches[3].trim()}` : matches[1].trim();
|
459
|
+
value = new Date(dateTime);
|
460
|
+
try {
|
461
|
+
value.toISOString();
|
462
|
+
} catch {
|
463
|
+
throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
|
464
|
+
}
|
465
|
+
} else if (isDate(arg1)) {
|
466
|
+
if (isNaN(arg1.getTime())) {
|
467
|
+
throw createCoreError(CoreErrorCodes.INVALID_DATE_ARGUMENT);
|
468
|
+
}
|
469
|
+
value = arg1;
|
470
|
+
} else if (isNumber(arg1)) {
|
471
|
+
value = arg1;
|
472
|
+
} else {
|
473
|
+
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
474
|
+
}
|
475
|
+
if (isString(arg2)) {
|
476
|
+
options.key = arg2;
|
477
|
+
} else if (isPlainObject(arg2)) {
|
478
|
+
Object.keys(arg2).forEach((key) => {
|
479
|
+
if (DATETIME_FORMAT_OPTIONS_KEYS.includes(key)) {
|
480
|
+
overrides[key] = arg2[key];
|
481
|
+
} else {
|
482
|
+
options[key] = arg2[key];
|
483
|
+
}
|
484
|
+
});
|
485
|
+
}
|
486
|
+
if (isString(arg3)) {
|
487
|
+
options.locale = arg3;
|
488
|
+
} else if (isPlainObject(arg3)) {
|
489
|
+
overrides = arg3;
|
490
|
+
}
|
491
|
+
if (isPlainObject(arg4)) {
|
492
|
+
overrides = arg4;
|
493
|
+
}
|
494
|
+
return [options.key || "", value, options, overrides];
|
495
|
+
}
|
496
|
+
function clearDateTimeFormat(ctx, locale, format2) {
|
497
|
+
const context = ctx;
|
498
|
+
for (const key in format2) {
|
499
|
+
const id = `${locale}__${key}`;
|
500
|
+
if (!context.__datetimeFormatters.has(id)) {
|
501
|
+
continue;
|
502
|
+
}
|
503
|
+
context.__datetimeFormatters.delete(id);
|
504
|
+
}
|
505
|
+
}
|
506
|
+
function number(context, ...args) {
|
507
|
+
const { numberFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
|
508
|
+
const { __numberFormatters } = context;
|
509
|
+
if (process.env.NODE_ENV !== "production" && !Availabilities.numberFormat) {
|
510
|
+
onWarn(getWarnMessage(CoreWarnCodes.CANNOT_FORMAT_NUMBER));
|
511
|
+
return MISSING_RESOLVE_VALUE;
|
512
|
+
}
|
513
|
+
const [key, value, options, overrides] = parseNumberArgs(...args);
|
514
|
+
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
|
515
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
|
516
|
+
const part = !!options.part;
|
517
|
+
const locale = getLocale(context, options);
|
518
|
+
const locales = localeFallbacker(
|
519
|
+
context,
|
520
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
521
|
+
fallbackLocale,
|
522
|
+
locale
|
523
|
+
);
|
524
|
+
if (!isString(key) || key === "") {
|
525
|
+
return new Intl.NumberFormat(locale, overrides).format(value);
|
526
|
+
}
|
527
|
+
let numberFormat = {};
|
528
|
+
let targetLocale;
|
529
|
+
let format2 = null;
|
530
|
+
let from = locale;
|
531
|
+
let to = null;
|
532
|
+
const type = "number format";
|
533
|
+
for (let i = 0; i < locales.length; i++) {
|
534
|
+
targetLocale = to = locales[i];
|
535
|
+
if (process.env.NODE_ENV !== "production" && locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
|
536
|
+
onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT, {
|
537
|
+
key,
|
538
|
+
target: targetLocale
|
539
|
+
}));
|
540
|
+
}
|
541
|
+
if (process.env.NODE_ENV !== "production" && locale !== targetLocale) {
|
542
|
+
const emitter = context.__v_emitter;
|
543
|
+
if (emitter) {
|
544
|
+
emitter.emit("fallback", {
|
545
|
+
type,
|
546
|
+
key,
|
547
|
+
from,
|
548
|
+
to,
|
549
|
+
groupId: `${type}:${key}`
|
550
|
+
});
|
551
|
+
}
|
552
|
+
}
|
553
|
+
numberFormat = numberFormats[targetLocale] || {};
|
554
|
+
format2 = numberFormat[key];
|
555
|
+
if (isPlainObject(format2))
|
556
|
+
break;
|
557
|
+
handleMissing(context, key, targetLocale, missingWarn, type);
|
558
|
+
from = to;
|
559
|
+
}
|
560
|
+
if (!isPlainObject(format2) || !isString(targetLocale)) {
|
561
|
+
return unresolving ? NOT_RESOLVED : key;
|
562
|
+
}
|
563
|
+
let id = `${targetLocale}__${key}`;
|
564
|
+
if (!isEmptyObject(overrides)) {
|
565
|
+
id = `${id}__${JSON.stringify(overrides)}`;
|
566
|
+
}
|
567
|
+
let formatter = __numberFormatters.get(id);
|
568
|
+
if (!formatter) {
|
569
|
+
formatter = new Intl.NumberFormat(targetLocale, assign({}, format2, overrides));
|
570
|
+
__numberFormatters.set(id, formatter);
|
571
|
+
}
|
572
|
+
return !part ? formatter.format(value) : formatter.formatToParts(value);
|
573
|
+
}
|
574
|
+
const NUMBER_FORMAT_OPTIONS_KEYS = [
|
575
|
+
"localeMatcher",
|
576
|
+
"style",
|
577
|
+
"currency",
|
578
|
+
"currencyDisplay",
|
579
|
+
"currencySign",
|
580
|
+
"useGrouping",
|
581
|
+
"minimumIntegerDigits",
|
582
|
+
"minimumFractionDigits",
|
583
|
+
"maximumFractionDigits",
|
584
|
+
"minimumSignificantDigits",
|
585
|
+
"maximumSignificantDigits",
|
586
|
+
"compactDisplay",
|
587
|
+
"notation",
|
588
|
+
"signDisplay",
|
589
|
+
"unit",
|
590
|
+
"unitDisplay",
|
591
|
+
"roundingMode",
|
592
|
+
"roundingPriority",
|
593
|
+
"roundingIncrement",
|
594
|
+
"trailingZeroDisplay"
|
595
|
+
];
|
596
|
+
function parseNumberArgs(...args) {
|
597
|
+
const [arg1, arg2, arg3, arg4] = args;
|
598
|
+
const options = create();
|
599
|
+
let overrides = create();
|
600
|
+
if (!isNumber(arg1)) {
|
601
|
+
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
602
|
+
}
|
603
|
+
const value = arg1;
|
604
|
+
if (isString(arg2)) {
|
605
|
+
options.key = arg2;
|
606
|
+
} else if (isPlainObject(arg2)) {
|
607
|
+
Object.keys(arg2).forEach((key) => {
|
608
|
+
if (NUMBER_FORMAT_OPTIONS_KEYS.includes(key)) {
|
609
|
+
overrides[key] = arg2[key];
|
610
|
+
} else {
|
611
|
+
options[key] = arg2[key];
|
612
|
+
}
|
613
|
+
});
|
614
|
+
}
|
615
|
+
if (isString(arg3)) {
|
616
|
+
options.locale = arg3;
|
617
|
+
} else if (isPlainObject(arg3)) {
|
618
|
+
overrides = arg3;
|
619
|
+
}
|
620
|
+
if (isPlainObject(arg4)) {
|
621
|
+
overrides = arg4;
|
622
|
+
}
|
623
|
+
return [options.key || "", value, options, overrides];
|
624
|
+
}
|
625
|
+
function clearNumberFormat(ctx, locale, format2) {
|
626
|
+
const context = ctx;
|
627
|
+
for (const key in format2) {
|
628
|
+
const id = `${locale}__${key}`;
|
629
|
+
if (!context.__numberFormatters.has(id)) {
|
630
|
+
continue;
|
631
|
+
}
|
632
|
+
context.__numberFormatters.delete(id);
|
633
|
+
}
|
634
|
+
}
|
635
|
+
const DEFAULT_MODIFIER = (str) => str;
|
636
|
+
const DEFAULT_MESSAGE = (ctx) => "";
|
637
|
+
const DEFAULT_MESSAGE_DATA_TYPE = "text";
|
638
|
+
const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : join(values);
|
639
|
+
const DEFAULT_INTERPOLATE = toDisplayString;
|
640
|
+
function pluralDefault(choice, choicesLength) {
|
641
|
+
choice = Math.abs(choice);
|
642
|
+
if (choicesLength === 2) {
|
643
|
+
return choice ? choice > 1 ? 1 : 0 : 1;
|
644
|
+
}
|
645
|
+
return choice ? Math.min(choice, 2) : 0;
|
646
|
+
}
|
647
|
+
function getPluralIndex(options) {
|
648
|
+
const index = isNumber(options.pluralIndex) ? options.pluralIndex : -1;
|
649
|
+
return options.named && (isNumber(options.named.count) || isNumber(options.named.n)) ? isNumber(options.named.count) ? options.named.count : isNumber(options.named.n) ? options.named.n : index : index;
|
650
|
+
}
|
651
|
+
function normalizeNamed(pluralIndex, props) {
|
652
|
+
if (!props.count) {
|
653
|
+
props.count = pluralIndex;
|
654
|
+
}
|
655
|
+
if (!props.n) {
|
656
|
+
props.n = pluralIndex;
|
657
|
+
}
|
658
|
+
}
|
659
|
+
function createMessageContext(options = {}) {
|
660
|
+
const locale = options.locale;
|
661
|
+
const pluralIndex = getPluralIndex(options);
|
662
|
+
const pluralRule = isObject(options.pluralRules) && isString(locale) && isFunction(options.pluralRules[locale]) ? options.pluralRules[locale] : pluralDefault;
|
663
|
+
const orgPluralRule = isObject(options.pluralRules) && isString(locale) && isFunction(options.pluralRules[locale]) ? pluralDefault : void 0;
|
664
|
+
const plural = (messages) => {
|
665
|
+
return messages[pluralRule(pluralIndex, messages.length, orgPluralRule)];
|
666
|
+
};
|
667
|
+
const _list = options.list || [];
|
668
|
+
const list = (index) => _list[index];
|
669
|
+
const _named = options.named || create();
|
670
|
+
isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
|
671
|
+
const named = (key) => _named[key];
|
672
|
+
function message(key, useLinked) {
|
673
|
+
const msg = isFunction(options.messages) ? options.messages(key, !!useLinked) : isObject(options.messages) ? options.messages[key] : false;
|
674
|
+
return !msg ? options.parent ? options.parent.message(key) : DEFAULT_MESSAGE : msg;
|
675
|
+
}
|
676
|
+
const _modifier = (name) => options.modifiers ? options.modifiers[name] : DEFAULT_MODIFIER;
|
677
|
+
const normalize = isPlainObject(options.processor) && isFunction(options.processor.normalize) ? options.processor.normalize : DEFAULT_NORMALIZE;
|
678
|
+
const interpolate = isPlainObject(options.processor) && isFunction(options.processor.interpolate) ? options.processor.interpolate : DEFAULT_INTERPOLATE;
|
679
|
+
const type = isPlainObject(options.processor) && isString(options.processor.type) ? options.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
|
680
|
+
const linked = (key, ...args) => {
|
681
|
+
const [arg1, arg2] = args;
|
682
|
+
let type2 = "text";
|
683
|
+
let modifier = "";
|
684
|
+
if (args.length === 1) {
|
685
|
+
if (isObject(arg1)) {
|
686
|
+
modifier = arg1.modifier || modifier;
|
687
|
+
type2 = arg1.type || type2;
|
688
|
+
} else if (isString(arg1)) {
|
689
|
+
modifier = arg1 || modifier;
|
690
|
+
}
|
691
|
+
} else if (args.length === 2) {
|
692
|
+
if (isString(arg1)) {
|
693
|
+
modifier = arg1 || modifier;
|
694
|
+
}
|
695
|
+
if (isString(arg2)) {
|
696
|
+
type2 = arg2 || type2;
|
697
|
+
}
|
698
|
+
}
|
699
|
+
const ret = message(key, true)(ctx);
|
700
|
+
const msg = (
|
701
|
+
// The message in vnode resolved with linked are returned as an array by processor.nomalize
|
702
|
+
type2 === "vnode" && isArray(ret) && modifier ? ret[0] : ret
|
703
|
+
);
|
704
|
+
return modifier ? _modifier(modifier)(msg, type2) : msg;
|
705
|
+
};
|
706
|
+
const ctx = {
|
707
|
+
[
|
708
|
+
"list"
|
709
|
+
/* HelperNameMap.LIST */
|
710
|
+
]: list,
|
711
|
+
[
|
712
|
+
"named"
|
713
|
+
/* HelperNameMap.NAMED */
|
714
|
+
]: named,
|
715
|
+
[
|
716
|
+
"plural"
|
717
|
+
/* HelperNameMap.PLURAL */
|
718
|
+
]: plural,
|
719
|
+
[
|
720
|
+
"linked"
|
721
|
+
/* HelperNameMap.LINKED */
|
722
|
+
]: linked,
|
723
|
+
[
|
724
|
+
"message"
|
725
|
+
/* HelperNameMap.MESSAGE */
|
726
|
+
]: message,
|
727
|
+
[
|
728
|
+
"type"
|
729
|
+
/* HelperNameMap.TYPE */
|
730
|
+
]: type,
|
731
|
+
[
|
732
|
+
"interpolate"
|
733
|
+
/* HelperNameMap.INTERPOLATE */
|
734
|
+
]: interpolate,
|
735
|
+
[
|
736
|
+
"normalize"
|
737
|
+
/* HelperNameMap.NORMALIZE */
|
738
|
+
]: normalize,
|
739
|
+
[
|
740
|
+
"values"
|
741
|
+
/* HelperNameMap.VALUES */
|
742
|
+
]: assign(create(), _list, _named)
|
743
|
+
};
|
744
|
+
return ctx;
|
745
|
+
}
|
746
|
+
const NOOP_MESSAGE_FUNCTION = () => "";
|
747
|
+
const isMessageFunction = (val) => isFunction(val);
|
748
|
+
function translate(context, ...args) {
|
749
|
+
const { fallbackFormat, postTranslation, unresolving, messageCompiler, fallbackLocale, messages } = context;
|
750
|
+
const [key, options] = parseTranslateArgs(...args);
|
751
|
+
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
|
752
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
|
753
|
+
const escapeParameter = isBoolean(options.escapeParameter) ? options.escapeParameter : context.escapeParameter;
|
754
|
+
const resolvedMessage = !!options.resolvedMessage;
|
755
|
+
const defaultMsgOrKey = isString(options.default) || isBoolean(options.default) ? !isBoolean(options.default) ? options.default : !messageCompiler ? () => key : key : fallbackFormat ? !messageCompiler ? () => key : key : null;
|
756
|
+
const enableDefaultMsg = fallbackFormat || defaultMsgOrKey != null && (isString(defaultMsgOrKey) || isFunction(defaultMsgOrKey));
|
757
|
+
const locale = getLocale(context, options);
|
758
|
+
escapeParameter && escapeParams(options);
|
759
|
+
let [formatScope, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [
|
760
|
+
key,
|
761
|
+
locale,
|
762
|
+
messages[locale] || create()
|
763
|
+
];
|
764
|
+
let format2 = formatScope;
|
765
|
+
let cacheBaseKey = key;
|
766
|
+
if (!resolvedMessage && !(isString(format2) || isMessageAST(format2) || isMessageFunction(format2))) {
|
767
|
+
if (enableDefaultMsg) {
|
768
|
+
format2 = defaultMsgOrKey;
|
769
|
+
cacheBaseKey = format2;
|
770
|
+
}
|
771
|
+
}
|
772
|
+
if (!resolvedMessage && (!(isString(format2) || isMessageAST(format2) || isMessageFunction(format2)) || !isString(targetLocale))) {
|
773
|
+
return unresolving ? NOT_RESOLVED : key;
|
774
|
+
}
|
775
|
+
if (process.env.NODE_ENV !== "production" && isString(format2) && context.messageCompiler == null) {
|
776
|
+
warn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${key}'.`);
|
777
|
+
return key;
|
778
|
+
}
|
779
|
+
let occurred = false;
|
780
|
+
const onError = () => {
|
781
|
+
occurred = true;
|
782
|
+
};
|
783
|
+
const msg = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) : format2;
|
784
|
+
if (occurred) {
|
785
|
+
return format2;
|
786
|
+
}
|
787
|
+
const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);
|
788
|
+
const msgContext = createMessageContext(ctxOptions);
|
789
|
+
const messaged = evaluateMessage(context, msg, msgContext);
|
790
|
+
const ret = postTranslation ? postTranslation(messaged, key) : messaged;
|
791
|
+
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
792
|
+
const payloads = {
|
793
|
+
timestamp: Date.now(),
|
794
|
+
key: isString(key) ? key : isMessageFunction(format2) ? format2.key : "",
|
795
|
+
locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
|
796
|
+
format: isString(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
|
797
|
+
message: ret
|
798
|
+
};
|
799
|
+
payloads.meta = assign({}, context.__meta, /* @__PURE__ */ getAdditionalMeta() || {});
|
800
|
+
translateDevTools(payloads);
|
801
|
+
}
|
802
|
+
return ret;
|
803
|
+
}
|
804
|
+
function escapeParams(options) {
|
805
|
+
if (isArray(options.list)) {
|
806
|
+
options.list = options.list.map((item) => isString(item) ? escapeHtml(item) : item);
|
807
|
+
} else if (isObject(options.named)) {
|
808
|
+
Object.keys(options.named).forEach((key) => {
|
809
|
+
if (isString(options.named[key])) {
|
810
|
+
options.named[key] = escapeHtml(options.named[key]);
|
811
|
+
}
|
812
|
+
});
|
813
|
+
}
|
814
|
+
}
|
815
|
+
function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
|
816
|
+
const { messages, onWarn, messageResolver: resolveValue, localeFallbacker } = context;
|
817
|
+
const locales = localeFallbacker(context, fallbackLocale, locale);
|
818
|
+
let message = create();
|
819
|
+
let targetLocale;
|
820
|
+
let format2 = null;
|
821
|
+
let from = locale;
|
822
|
+
let to = null;
|
823
|
+
const type = "translate";
|
824
|
+
for (let i = 0; i < locales.length; i++) {
|
825
|
+
targetLocale = to = locales[i];
|
826
|
+
if (process.env.NODE_ENV !== "production" && locale !== targetLocale && !isAlmostSameLocale(locale, targetLocale) && isTranslateFallbackWarn(fallbackWarn, key)) {
|
827
|
+
onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_TRANSLATE, {
|
828
|
+
key,
|
829
|
+
target: targetLocale
|
830
|
+
}));
|
831
|
+
}
|
832
|
+
if (process.env.NODE_ENV !== "production" && locale !== targetLocale) {
|
833
|
+
const emitter = context.__v_emitter;
|
834
|
+
if (emitter) {
|
835
|
+
emitter.emit("fallback", {
|
836
|
+
type,
|
837
|
+
key,
|
838
|
+
from,
|
839
|
+
to,
|
840
|
+
groupId: `${type}:${key}`
|
841
|
+
});
|
842
|
+
}
|
843
|
+
}
|
844
|
+
message = messages[targetLocale] || create();
|
845
|
+
let start = null;
|
846
|
+
let startTag;
|
847
|
+
let endTag;
|
848
|
+
if (process.env.NODE_ENV !== "production" && inBrowser) {
|
849
|
+
start = window.performance.now();
|
850
|
+
startTag = "intlify-message-resolve-start";
|
851
|
+
endTag = "intlify-message-resolve-end";
|
852
|
+
mark && mark(startTag);
|
853
|
+
}
|
854
|
+
if ((format2 = resolveValue(message, key)) === null) {
|
855
|
+
format2 = message[key];
|
856
|
+
}
|
857
|
+
if (process.env.NODE_ENV !== "production" && inBrowser) {
|
858
|
+
const end = window.performance.now();
|
859
|
+
const emitter = context.__v_emitter;
|
860
|
+
if (emitter && start && format2) {
|
861
|
+
emitter.emit("message-resolve", {
|
862
|
+
type: "message-resolve",
|
863
|
+
key,
|
864
|
+
message: format2,
|
865
|
+
time: end - start,
|
866
|
+
groupId: `${type}:${key}`
|
867
|
+
});
|
868
|
+
}
|
869
|
+
if (startTag && endTag && mark && measure) {
|
870
|
+
mark(endTag);
|
871
|
+
measure("intlify message resolve", startTag, endTag);
|
872
|
+
}
|
873
|
+
}
|
874
|
+
if (isString(format2) || isMessageAST(format2) || isMessageFunction(format2)) {
|
875
|
+
break;
|
876
|
+
}
|
877
|
+
if (!isImplicitFallback(targetLocale, locales)) {
|
878
|
+
const missingRet = handleMissing(
|
879
|
+
context,
|
880
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
881
|
+
key,
|
882
|
+
targetLocale,
|
883
|
+
missingWarn,
|
884
|
+
type
|
885
|
+
);
|
886
|
+
if (missingRet !== key) {
|
887
|
+
format2 = missingRet;
|
888
|
+
}
|
889
|
+
}
|
890
|
+
from = to;
|
891
|
+
}
|
892
|
+
return [format2, targetLocale, message];
|
893
|
+
}
|
894
|
+
function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) {
|
895
|
+
const { messageCompiler, warnHtmlMessage } = context;
|
896
|
+
if (isMessageFunction(format2)) {
|
897
|
+
const msg2 = format2;
|
898
|
+
msg2.locale = msg2.locale || targetLocale;
|
899
|
+
msg2.key = msg2.key || key;
|
900
|
+
return msg2;
|
901
|
+
}
|
902
|
+
if (messageCompiler == null) {
|
903
|
+
const msg2 = () => format2;
|
904
|
+
msg2.locale = targetLocale;
|
905
|
+
msg2.key = key;
|
906
|
+
return msg2;
|
907
|
+
}
|
908
|
+
let start = null;
|
909
|
+
let startTag;
|
910
|
+
let endTag;
|
911
|
+
if (process.env.NODE_ENV !== "production" && inBrowser) {
|
912
|
+
start = window.performance.now();
|
913
|
+
startTag = "intlify-message-compilation-start";
|
914
|
+
endTag = "intlify-message-compilation-end";
|
915
|
+
mark && mark(startTag);
|
916
|
+
}
|
917
|
+
const msg = messageCompiler(format2, getCompileContext(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, onError));
|
918
|
+
if (process.env.NODE_ENV !== "production" && inBrowser) {
|
919
|
+
const end = window.performance.now();
|
920
|
+
const emitter = context.__v_emitter;
|
921
|
+
if (emitter && start) {
|
922
|
+
emitter.emit("message-compilation", {
|
923
|
+
type: "message-compilation",
|
924
|
+
message: format2,
|
925
|
+
time: end - start,
|
926
|
+
groupId: `${"translate"}:${key}`
|
927
|
+
});
|
928
|
+
}
|
929
|
+
if (startTag && endTag && mark && measure) {
|
930
|
+
mark(endTag);
|
931
|
+
measure("intlify message compilation", startTag, endTag);
|
932
|
+
}
|
933
|
+
}
|
934
|
+
msg.locale = targetLocale;
|
935
|
+
msg.key = key;
|
936
|
+
msg.source = format2;
|
937
|
+
return msg;
|
938
|
+
}
|
939
|
+
function evaluateMessage(context, msg, msgCtx) {
|
940
|
+
let start = null;
|
941
|
+
let startTag;
|
942
|
+
let endTag;
|
943
|
+
if (process.env.NODE_ENV !== "production" && inBrowser) {
|
944
|
+
start = window.performance.now();
|
945
|
+
startTag = "intlify-message-evaluation-start";
|
946
|
+
endTag = "intlify-message-evaluation-end";
|
947
|
+
mark && mark(startTag);
|
948
|
+
}
|
949
|
+
const messaged = msg(msgCtx);
|
950
|
+
if (process.env.NODE_ENV !== "production" && inBrowser) {
|
951
|
+
const end = window.performance.now();
|
952
|
+
const emitter = context.__v_emitter;
|
953
|
+
if (emitter && start) {
|
954
|
+
emitter.emit("message-evaluation", {
|
955
|
+
type: "message-evaluation",
|
956
|
+
value: messaged,
|
957
|
+
time: end - start,
|
958
|
+
groupId: `${"translate"}:${msg.key}`
|
959
|
+
});
|
960
|
+
}
|
961
|
+
if (startTag && endTag && mark && measure) {
|
962
|
+
mark(endTag);
|
963
|
+
measure("intlify message evaluation", startTag, endTag);
|
964
|
+
}
|
965
|
+
}
|
966
|
+
return messaged;
|
967
|
+
}
|
968
|
+
function parseTranslateArgs(...args) {
|
969
|
+
const [arg1, arg2, arg3] = args;
|
970
|
+
const options = create();
|
971
|
+
if (!isString(arg1) && !isNumber(arg1) && !isMessageFunction(arg1) && !isMessageAST(arg1)) {
|
972
|
+
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
973
|
+
}
|
974
|
+
const key = isNumber(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
|
975
|
+
if (isNumber(arg2)) {
|
976
|
+
options.plural = arg2;
|
977
|
+
} else if (isString(arg2)) {
|
978
|
+
options.default = arg2;
|
979
|
+
} else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {
|
980
|
+
options.named = arg2;
|
981
|
+
} else if (isArray(arg2)) {
|
982
|
+
options.list = arg2;
|
983
|
+
}
|
984
|
+
if (isNumber(arg3)) {
|
985
|
+
options.plural = arg3;
|
986
|
+
} else if (isString(arg3)) {
|
987
|
+
options.default = arg3;
|
988
|
+
} else if (isPlainObject(arg3)) {
|
989
|
+
assign(options, arg3);
|
990
|
+
}
|
991
|
+
return [key, options];
|
992
|
+
}
|
993
|
+
function getCompileContext(context, locale, key, source, warnHtmlMessage, onError) {
|
994
|
+
return {
|
995
|
+
locale,
|
996
|
+
key,
|
997
|
+
warnHtmlMessage,
|
998
|
+
onError: (err) => {
|
999
|
+
onError && onError(err);
|
1000
|
+
if (process.env.NODE_ENV !== "production") {
|
1001
|
+
const _source = getSourceForCodeFrame(source);
|
1002
|
+
const message = `Message compilation error: ${err.message}`;
|
1003
|
+
const codeFrame = err.location && _source && generateCodeFrame(_source, err.location.start.offset, err.location.end.offset);
|
1004
|
+
const emitter = context.__v_emitter;
|
1005
|
+
if (emitter && _source) {
|
1006
|
+
emitter.emit("compile-error", {
|
1007
|
+
message: _source,
|
1008
|
+
error: err.message,
|
1009
|
+
start: err.location && err.location.start.offset,
|
1010
|
+
end: err.location && err.location.end.offset,
|
1011
|
+
groupId: `${"translate"}:${key}`
|
1012
|
+
});
|
1013
|
+
}
|
1014
|
+
console.error(codeFrame ? `${message}
|
1015
|
+
${codeFrame}` : message);
|
1016
|
+
} else {
|
1017
|
+
throw err;
|
1018
|
+
}
|
1019
|
+
},
|
1020
|
+
onCacheKey: (source2) => generateFormatCacheKey(locale, key, source2)
|
1021
|
+
};
|
1022
|
+
}
|
1023
|
+
function getSourceForCodeFrame(source) {
|
1024
|
+
if (isString(source)) {
|
1025
|
+
return source;
|
1026
|
+
} else {
|
1027
|
+
if (source.loc && source.loc.source) {
|
1028
|
+
return source.loc.source;
|
1029
|
+
}
|
1030
|
+
}
|
1031
|
+
}
|
1032
|
+
function getMessageContextOptions(context, locale, message, options) {
|
1033
|
+
const { modifiers, pluralRules, messageResolver: resolveValue, fallbackLocale, fallbackWarn, missingWarn, fallbackContext } = context;
|
1034
|
+
const resolveMessage = (key, useLinked) => {
|
1035
|
+
let val = resolveValue(message, key);
|
1036
|
+
if (val == null && (fallbackContext || useLinked)) {
|
1037
|
+
const [, , message2] = resolveMessageFormat(
|
1038
|
+
fallbackContext || context,
|
1039
|
+
// NOTE: if has fallbackContext, fallback to root, else if use linked, fallback to local context
|
1040
|
+
key,
|
1041
|
+
locale,
|
1042
|
+
fallbackLocale,
|
1043
|
+
fallbackWarn,
|
1044
|
+
missingWarn
|
1045
|
+
);
|
1046
|
+
val = resolveValue(message2, key);
|
1047
|
+
}
|
1048
|
+
if (isString(val) || isMessageAST(val)) {
|
1049
|
+
let occurred = false;
|
1050
|
+
const onError = () => {
|
1051
|
+
occurred = true;
|
1052
|
+
};
|
1053
|
+
const msg = compileMessageFormat(context, key, locale, val, key, onError);
|
1054
|
+
return !occurred ? msg : NOOP_MESSAGE_FUNCTION;
|
1055
|
+
} else if (isMessageFunction(val)) {
|
1056
|
+
return val;
|
1057
|
+
} else {
|
1058
|
+
return NOOP_MESSAGE_FUNCTION;
|
1059
|
+
}
|
1060
|
+
};
|
1061
|
+
const ctxOptions = {
|
1062
|
+
locale,
|
1063
|
+
modifiers,
|
1064
|
+
pluralRules,
|
1065
|
+
messages: resolveMessage
|
1066
|
+
};
|
1067
|
+
if (context.processor) {
|
1068
|
+
ctxOptions.processor = context.processor;
|
1069
|
+
}
|
1070
|
+
if (options.list) {
|
1071
|
+
ctxOptions.list = options.list;
|
1072
|
+
}
|
1073
|
+
if (options.named) {
|
1074
|
+
ctxOptions.named = options.named;
|
1075
|
+
}
|
1076
|
+
if (isNumber(options.plural)) {
|
1077
|
+
ctxOptions.pluralIndex = options.plural;
|
1078
|
+
}
|
1079
|
+
return ctxOptions;
|
1080
|
+
}
|
1081
|
+
{
|
1082
|
+
initFeatureFlags();
|
1083
|
+
}
|
1084
|
+
export {
|
1085
|
+
AST_NODE_PROPS_KEYS,
|
1086
|
+
CORE_ERROR_CODES_EXTEND_POINT,
|
1087
|
+
CORE_WARN_CODES_EXTEND_POINT,
|
1088
|
+
CoreWarnCodes,
|
1089
|
+
DATETIME_FORMAT_OPTIONS_KEYS,
|
1090
|
+
DEFAULT_LOCALE,
|
1091
|
+
DEFAULT_MESSAGE_DATA_TYPE,
|
1092
|
+
MISSING_RESOLVE_VALUE,
|
1093
|
+
NOT_RESOLVED,
|
1094
|
+
NUMBER_FORMAT_OPTIONS_KEYS,
|
1095
|
+
VERSION,
|
1096
|
+
clearDateTimeFormat,
|
1097
|
+
clearNumberFormat,
|
1098
|
+
createCompileError,
|
1099
|
+
createCoreContext,
|
1100
|
+
createCoreError,
|
1101
|
+
createMessageContext,
|
1102
|
+
datetime,
|
1103
|
+
fallbackWithLocaleChain,
|
1104
|
+
fallbackWithSimple,
|
1105
|
+
getAdditionalMeta,
|
1106
|
+
getFallbackContext,
|
1107
|
+
getLocale,
|
1108
|
+
getWarnMessage,
|
1109
|
+
handleMissing,
|
1110
|
+
initI18nDevTools,
|
1111
|
+
isAlmostSameLocale,
|
1112
|
+
isImplicitFallback,
|
1113
|
+
isMessageAST,
|
1114
|
+
isMessageFunction,
|
1115
|
+
isTranslateFallbackWarn,
|
1116
|
+
isTranslateMissingWarn,
|
1117
|
+
number,
|
1118
|
+
parseDateTimeArgs,
|
1119
|
+
parseNumberArgs,
|
1120
|
+
parseTranslateArgs,
|
1121
|
+
resolveLocale,
|
1122
|
+
resolveWithKeyValue,
|
1123
|
+
setAdditionalMeta,
|
1124
|
+
setDevToolsHook,
|
1125
|
+
setFallbackContext,
|
1126
|
+
translate,
|
1127
|
+
translateDevTools,
|
1128
|
+
updateFallbackLocale
|
1129
|
+
};
|