2020-09-22 11:09:56 +08:00

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 };
}