mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 18:42:56 +00:00
feat: suport more locale config
This commit is contained in:
parent
7a40aff277
commit
4728484e7e
@ -9,10 +9,10 @@ const instance: Record<string, Record<string, string>> = {
|
||||
|
||||
export function createIntl(locale: string = 'zh-CN') {
|
||||
const intl = (id: string) => {
|
||||
return instance[locale][id];
|
||||
return instance[locale]?.[id] || id;
|
||||
};
|
||||
|
||||
const intlNode = (id: string) => createElement('span', instance[locale][id]);
|
||||
const intlNode = (id: string) => createElement('span', instance[locale]?.[id] || id);
|
||||
|
||||
return {
|
||||
intl,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user