fix: translation in mobile (#929)

Reviewed-on: daoyoucloud/tachybase#929
This commit is contained in:
sealday 2024-05-08 19:30:55 +08:00
parent eeab93244f
commit c08a8a3557

View File

@ -3,9 +3,6 @@ import { useTranslation as useT } from 'react-i18next';
export const NAMESPACE = 'mobile-client'; export const NAMESPACE = 'mobile-client';
// i18n.addResources('zh-CN', NAMESPACE, zhCN);
// i18n.addResources('en-US', NAMESPACE, enUS);
export function lang(key: string) { export function lang(key: string) {
return i18n.t(key, { ns: NAMESPACE }); return i18n.t(key, { ns: NAMESPACE });
} }
@ -17,7 +14,7 @@ export function generateNTemplate(key: string) {
export const tval = (key: string) => nTval(key, { ns: NAMESPACE }); export const tval = (key: string) => nTval(key, { ns: NAMESPACE });
export function useTranslation() { export function useTranslation() {
return useT([NAMESPACE, 'client'], { return useT([NAMESPACE, '@tachybase/plugin-mobile-client', 'client'], {
nsMode: 'fallback', nsMode: 'fallback',
}); });
} }