tachybase_todo/packages/plugins/@hera/plugin-approval/src/client/locale.ts
bai.zixv 1b59cb2a6b feat: 工作流审批组件完善 (#673)
Co-authored-by: sealday <zhanglin@daoyoucloud.com>
Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#673
Co-authored-by: bai.zixv <bai.zixv@foxmail.com>
Co-committed-by: bai.zixv <bai.zixv@foxmail.com>
2024-04-23 20:51:33 +08:00

21 lines
509 B
TypeScript

import { i18n, tval as nTval } from '@nocobase/client';
export const NAMESPACE = '@hera/plugin-approval';
export function usePluginTranslation(): any {
return useTranslation();
}
export function useTranslation() {
const t = (key: string, options = {}) => i18n.t(key, { ns: NAMESPACE, ...options });
return { t };
}
export function lang(key: string, options = {}) {
return i18n.t(key, {
...options,
ns: NAMESPACE,
});
}
export const tval = (key: string) => nTval(key, { ns: NAMESPACE });