feat: Support Traditional Chinese (#336)

### What problem does this PR solve?

Support Traditional Chinese

Issue link: #335
### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-04-12 11:41:00 +08:00
committed by GitHub
parent e20207101a
commit f173fe6e47
10 changed files with 470 additions and 24 deletions

View File

@@ -1,3 +1,4 @@
import { LanguageTranslationMap } from '@/constants/common';
import { ITenantInfo } from '@/interfaces/database/knowledge';
import {
IFactory,
@@ -66,7 +67,11 @@ const model: DvaModel<SettingModelState> = {
// };
// authorizationUtil.setUserInfo(userInfo);
if (retcode === 0) {
i18n.changeLanguage(res.language === 'Chinese' ? 'zh' : 'en');
i18n.changeLanguage(
LanguageTranslationMap[
res.language as keyof typeof LanguageTranslationMap
],
);
yield put({ type: 'setUserInfo', payload: res });
// localStorage.setItem('userInfo',res.)
}