mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
Merge branch 'fix-i18n'
This commit is contained in:
commit
96bd14c98c
@ -20,11 +20,23 @@ export function register(name: string, config: LocaleConfig) {
|
||||
extendLocale(name, config);
|
||||
}
|
||||
|
||||
export function extendLocale(name: string, config: LocaleConfig) {
|
||||
locales[name] = {
|
||||
...(locales[name] || {}),
|
||||
...config
|
||||
};
|
||||
export function extendLocale(
|
||||
name: string,
|
||||
config: LocaleConfig,
|
||||
cover: boolean = true
|
||||
) {
|
||||
if (cover) {
|
||||
// 覆盖式扩展语料
|
||||
locales[name] = {
|
||||
...(locales[name] || {}),
|
||||
...config
|
||||
};
|
||||
} else {
|
||||
locales[name] = {
|
||||
...config,
|
||||
...(locales[name] || {})
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除语料数据 */
|
||||
|
Loading…
Reference in New Issue
Block a user