mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-07 06:16:02 +00:00
chore: change zh_CN to zh_Hans
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -9,7 +9,7 @@ export interface ApiResponse<T> {
|
||||
|
||||
export interface I18nText {
|
||||
en_US: string;
|
||||
zh_CN: string;
|
||||
zh_Hans: string;
|
||||
}
|
||||
|
||||
export interface AsyncTaskCreatedResp {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export interface I18nLabel {
|
||||
en_US: string;
|
||||
zh_CN: string;
|
||||
zh_Hans: string;
|
||||
ja_JP?: string;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user