fix: translation in mobile (#929)
Reviewed-on: daoyoucloud/tachybase#929
This commit is contained in:
parent
eeab93244f
commit
c08a8a3557
@ -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',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user