变更
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { m as makeSymbol, a as assign, i as isNumber, b as isString, c as isObject, d as isArray, e as isBoolean, f as createCompileError, g as isEmptyObject, r as registerMessageCompiler, h as getGlobalThis, s as setDevToolsHook, j as isPlainObject, k as hasOwn, l as handleFlatJson, n as isRegExp, o as isFunction, p as createCoreContext, u as updateFallbackLocale, q as compileToFunction, t as resolveValue, v as clearDateTimeFormat, w as clearNumberFormat, x as setAdditionalMeta, N as NOT_REOSLVED, y as parseTranslateArgs, z as translate, M as MISSING_RESOLVE_VALUE, A as parseDateTimeArgs, B as datetime, C as parseNumberArgs, D as number, E as getLocaleChain } from "../@intlify/index.js";
|
||||
import { h, Fragment, getCurrentInstance, inject, onMounted, onUnmounted, isRef, ref, computed, watch, createVNode, Text } from "vue";
|
||||
import { m as makeSymbol, a as assign, i as isNumber, b as isString, c as isObject, d as isBoolean, e as isEmptyObject, r as registerMessageCompiler, g as getGlobalThis, s as setDevToolsHook, f as createCompileError, h as isPlainObject, j as isArray, k as hasOwn, l as handleFlatJson, n as isRegExp, o as isFunction, u as updateFallbackLocale, p as compileToFunction, q as createCoreContext, t as resolveValue, v as clearDateTimeFormat, w as clearNumberFormat, x as setAdditionalMeta, N as NOT_REOSLVED, y as parseTranslateArgs, z as translate, M as MISSING_RESOLVE_VALUE, A as parseDateTimeArgs, B as datetime, C as parseNumberArgs, D as number, E as getLocaleChain } from "../@intlify/index.js";
|
||||
import { h, Fragment, getCurrentInstance, inject, onMounted, onUnmounted, ref, computed, watch, isRef, createVNode, Text } from "vue";
|
||||
/*!
|
||||
* vue-i18n v9.1.10
|
||||
* (c) 2022 kazuya kawaguchi
|
||||
@@ -80,8 +80,12 @@ function createComposer(options = {}) {
|
||||
const { __root } = options;
|
||||
const _isGlobal = __root === void 0;
|
||||
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
||||
const _locale = ref(__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US");
|
||||
const _fallbackLocale = ref(__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value);
|
||||
const _locale = ref(
|
||||
__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US"
|
||||
);
|
||||
const _fallbackLocale = ref(
|
||||
__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
|
||||
);
|
||||
const _messages = ref(getLocaleMessages(_locale.value, options));
|
||||
const _datetimeFormats = ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
||||
const _numberFormats = ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
||||
@@ -215,23 +219,44 @@ function createComposer(options = {}) {
|
||||
type: "vnode"
|
||||
};
|
||||
function transrateVNode(...args) {
|
||||
return wrapWithDeps((context) => {
|
||||
let ret;
|
||||
const _context2 = context;
|
||||
try {
|
||||
_context2.processor = processor;
|
||||
ret = translate(_context2, ...args);
|
||||
} finally {
|
||||
_context2.processor = null;
|
||||
}
|
||||
return ret;
|
||||
}, () => parseTranslateArgs(...args), "translate", (root) => root[TransrateVNodeSymbol](...args), (key) => [createVNode(Text, null, key, 0)], (val) => isArray(val));
|
||||
return wrapWithDeps(
|
||||
(context) => {
|
||||
let ret;
|
||||
const _context2 = context;
|
||||
try {
|
||||
_context2.processor = processor;
|
||||
ret = translate(_context2, ...args);
|
||||
} finally {
|
||||
_context2.processor = null;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
() => parseTranslateArgs(...args),
|
||||
"translate",
|
||||
(root) => root[TransrateVNodeSymbol](...args),
|
||||
(key) => [createVNode(Text, null, key, 0)],
|
||||
(val) => isArray(val)
|
||||
);
|
||||
}
|
||||
function numberParts(...args) {
|
||||
return wrapWithDeps((context) => number(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root[NumberPartsSymbol](...args), () => [], (val) => isString(val) || isArray(val));
|
||||
return wrapWithDeps(
|
||||
(context) => number(context, ...args),
|
||||
() => parseNumberArgs(...args),
|
||||
"number format",
|
||||
(root) => root[NumberPartsSymbol](...args),
|
||||
() => [],
|
||||
(val) => isString(val) || isArray(val)
|
||||
);
|
||||
}
|
||||
function datetimeParts(...args) {
|
||||
return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root[DatetimePartsSymbol](...args), () => [], (val) => isString(val) || isArray(val));
|
||||
return wrapWithDeps(
|
||||
(context) => datetime(context, ...args),
|
||||
() => parseDateTimeArgs(...args),
|
||||
"datetime format",
|
||||
(root) => root[DatetimePartsSymbol](...args),
|
||||
() => [],
|
||||
(val) => isString(val) || isArray(val)
|
||||
);
|
||||
}
|
||||
function setPluralRules(rules) {
|
||||
_pluralRules = rules;
|
||||
|
||||
Reference in New Issue
Block a user