mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 19:17:54 +08:00
fix: 国际化兜底处理 (#5877)
This commit is contained in:
parent
5c98f8a97b
commit
717e01fb07
@ -51,8 +51,12 @@ export function makeTranslator(locale?: string): TranslateFn {
|
||||
return str;
|
||||
}
|
||||
|
||||
const dict = locales[locale!] || locales[defaultLocale] || locales['zh-CN'];
|
||||
return format(dict?.[str] || str, ...args);
|
||||
const value =
|
||||
locales[locale!]?.[str] ||
|
||||
locales[defaultLocale]?.[str] ||
|
||||
locales['zh-CN']?.[str] ||
|
||||
str;
|
||||
return format(value, ...args);
|
||||
};
|
||||
|
||||
locale && (fns[locale] = fn);
|
||||
|
Loading…
Reference in New Issue
Block a user