提交 0361bc0e 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix(i18n): 默认语言跟随系部分语言失败及回退语言异常 (question/165884)

上级 074ae4df
......@@ -84,7 +84,7 @@ function resolveI18nLocale (platfrom, locales, locale) {
return locale
}
const defaultLocales = ['zh-Hans', 'zh-Hant']
if (platfrom === 'app' || platfrom === 'h5') {
if (platfrom === 'app-plus' || platfrom === 'h5') {
defaultLocales.unshift('en')
} else {
// 小程序
......@@ -96,4 +96,4 @@ function resolveI18nLocale (platfrom, locales, locale) {
module.exports = {
initLocales,
initI18nOptions
}
}
......@@ -47,8 +47,8 @@ export declare interface I18nOptions {
export declare function initVueI18n(locale?: string, messages?: LocaleMessages, fallbackLocale?: string, watcher?: (locale: string) => void): {
i18n: I18n;
f(message: string, values?: Record<string, unknown> | unknown[] | undefined, delimiters?: [string, string] | undefined): string;
t(key: string, values?: Record<string, unknown> | unknown[] | undefined): string;
f(message: string, values?: Record<string, unknown> | Array<unknown>, delimiters?: [string, string]): string;
t(key: string, values?: Record<string, unknown> | Array<unknown>): string;
add(locale: BuiltInLocale, message: Record<string, string>, override?: boolean): void;
watch(fn: LocaleWatcher): () => void;
getLocale(): string;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册