chore: change zh_CN to zh_Hans

This commit is contained in:
Junyan Qin
2025-05-14 16:44:48 +08:00
parent 6652b57a0d
commit c835555a59
42 changed files with 247 additions and 247 deletions

View File

@@ -9,7 +9,7 @@ export const testDynamicConfigList: IDynamicFormItemSchema[] = [
default: '',
id: '111',
label: {
zh_CN: '测试字段string',
zh_Hans: '测试字段string',
en_US: 'eng test',
},
name: 'string_test',
@@ -20,7 +20,7 @@ export const testDynamicConfigList: IDynamicFormItemSchema[] = [
default: '',
id: '222',
label: {
zh_CN: '测试字段int',
zh_Hans: '测试字段int',
en_US: 'int eng test',
},
name: 'int_test',
@@ -31,7 +31,7 @@ export const testDynamicConfigList: IDynamicFormItemSchema[] = [
default: '',
id: '333',
label: {
zh_CN: '测试字段boolean',
zh_Hans: '测试字段boolean',
en_US: 'boolean eng test',
},
name: 'boolean_test',

View File

@@ -9,7 +9,7 @@ export interface ApiResponse<T> {
export interface I18nText {
en_US: string;
zh_CN: string;
zh_Hans: string;
}
export interface AsyncTaskCreatedResp {

View File

@@ -1,5 +1,5 @@
export interface I18nLabel {
en_US: string;
zh_CN: string;
zh_Hans: string;
ja_JP?: string;
}

View File

@@ -13,8 +13,8 @@ export default function I18nProvider({ children }: I18nProviderProps) {
}
export function i18nObj(i18nText: I18nText): string {
const language = localStorage.getItem('langbot_language');
if ((language === 'zh-Hans' && i18nText.zh_CN) || !i18nText.en_US) {
return i18nText.zh_CN;
if ((language === 'zh-Hans' && i18nText.zh_Hans) || !i18nText.en_US) {
return i18nText.zh_Hans;
}
return i18nText.en_US;
}