mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-01 22:10:27 +00:00
16 lines
432 B
TypeScript
16 lines
432 B
TypeScript
|
|
|
|
export function isUseI18NSetter(prototype: any, propName: string) {
|
|
const configure = prototype?.options?.configure;
|
|
if (Array.isArray(configure)) {
|
|
return configure.some(c => {
|
|
return c.name === propName && c?.setter?.type?.displayName === 'I18nSetter';
|
|
});
|
|
}
|
|
return false;
|
|
}
|
|
|
|
export function convertToI18NObject(v: string, locale: string = 'zh_CN') {
|
|
return { type: 'i18n', use: locale, [locale]: v };
|
|
}
|