Skip to content

Commit 29ddee8

Browse files
committed
feat: i18n
1 parent fd7383c commit 29ddee8

File tree

14 files changed

+283
-14
lines changed

14 files changed

+283
-14
lines changed

apps/application/serializers/application_serializers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ def one(self, with_valid=True):
399399
'access_num': application_access_token.access_num,
400400
'white_active': application_access_token.white_active,
401401
'white_list': application_access_token.white_list,
402-
'show_source': application_access_token.show_source
402+
'show_source': application_access_token.show_source,
403+
'language': application_access_token.language
403404
}
404405

405406
class Authentication(serializers.Serializer):
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export default {
2+
noHistory: 'No History',
3+
createChat: 'Create New Chat',
4+
history: 'History',
5+
only20history: 'Only showing the last 20 conversations',
6+
question_count: 'Questions',
7+
exportRecords: 'Export Chat Records',
8+
chatId: 'Chat ID',
9+
userInput: 'User Input',
10+
passwordValidator: {
11+
title: 'Enter password to open the link',
12+
errorMessage1: 'Password cannot be empty',
13+
errorMessage2: 'Incorrect password'
14+
},
15+
tip: {
16+
error500Message: 'Sorry, the service is currently under maintenance. Please try again later!',
17+
errorIdentifyMessage: 'Unable to identify user',
18+
errorLimitMessage:
19+
'Sorry, you have reached the maximum number of questions. Please try again tomorrow!'
20+
},
21+
executionDetails: {
22+
title: 'Execution Details',
23+
paramInput: 'Parameter Input',
24+
paramOutput: 'Parameter Output'
25+
},
26+
KnowledgeSource: {
27+
title: 'Knowledge Source',
28+
referenceParagraph: 'Referenced Paragraph',
29+
consume: 'Consumption',
30+
consumeTime: 'Time Consumed'
31+
}
32+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
export default {
2+
input_type_list: {
3+
TextInput: 'Text Input',
4+
Slider: 'Slider',
5+
SwitchInput: 'Switch',
6+
SingleSelect: 'Single Select',
7+
MultiSelect: 'Multi Select',
8+
DatePicker: 'Date Picker',
9+
JsonInput: 'JSON Text Input',
10+
RadioCard: 'Radio Card',
11+
RadioRow: 'Radio Row'
12+
},
13+
default: {
14+
label: 'Default Value',
15+
placeholder: 'Please enter a default value',
16+
requiredMessage: 'Default Value is a required property',
17+
show: 'Show Default Value'
18+
},
19+
tip: {
20+
requiredMessage: 'Cannot be empty',
21+
jsonMessage: 'Incorrect JSON format'
22+
},
23+
searchBar: {
24+
placeholder: 'Please enter keywords to search'
25+
},
26+
paramForm: {
27+
field: {
28+
label: 'Parameter',
29+
placeholder: 'Please enter a parameter',
30+
requiredMessage: 'Parameter is a required property',
31+
requiredMessage2: 'Only letters, numbers, and underscores are allowed'
32+
},
33+
name: {
34+
label: 'Display Name',
35+
placeholder: 'Please enter a display name',
36+
requiredMessage: 'Display Name is a required property'
37+
},
38+
tooltip: {
39+
label: 'Parameter Tooltip',
40+
placeholder: 'Please enter a parameter tooltip'
41+
},
42+
required: {
43+
label: 'Is Required',
44+
requiredMessage: 'Is Required is a required property'
45+
},
46+
input_type: {
47+
label: 'Component Type',
48+
placeholder: 'Please select a component type',
49+
requiredMessage: 'Component Type is a required property'
50+
}
51+
},
52+
DatePicker: {
53+
placeholder: 'Select Date',
54+
year: 'Year',
55+
month: 'Month',
56+
date: 'Date',
57+
datetime: 'Date Time',
58+
dataType: {
59+
label: 'Date Type',
60+
placeholder: 'Please select a date type'
61+
},
62+
format: {
63+
label: 'Format',
64+
placeholder: 'Please select a format'
65+
}
66+
},
67+
Select: {
68+
label: 'Option Value',
69+
placeholder: 'Please enter an option value'
70+
},
71+
tag: {
72+
label: 'Tag',
73+
placeholder: 'Please enter an option label'
74+
},
75+
Slider: {
76+
showInput: ''
77+
}
78+
}
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
1+
import dynamicsForm from './dynamics-form'
2+
import chat from './ai-chat'
23
export default {
3-
4-
};
4+
dynamicsForm,
5+
chat,
6+
noData: 'No Data'
7+
}

ui/src/locales/lang/en_US/views/application-overview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default {
6262
},
6363
SettingDisplayDialog: {
6464
dialogTitle: 'Display Settings',
65+
languageLabel: 'Language',
6566
showSourceLabel: 'Show Source',
6667
showExecutionDetail: 'Show Execution Detail',
6768
restoreDefault: 'Restore Default',

ui/src/locales/lang/zh_CN/components/ai-chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
history: '历史记录',
55
only20history: '仅显示最近 20 条对话',
66
question_count: '条提问',
7-
exportReords: '导出聊天记录',
7+
exportRecords: '导出聊天记录',
88
chatId: '对话id',
99
userInput: '用户输入',
1010
passwordValidator: {

ui/src/locales/lang/zh_CN/views/application-overview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default {
6262
},
6363
SettingDisplayDialog: {
6464
dialogTitle: '显示设置',
65+
languageLabel: '语言',
6566
showSourceLabel: '显示知识来源',
6667
showExecutionDetail: '显示执行详情',
6768
restoreDefault: '恢复默认',
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
export default {
2+
noHistory: '暫無歷史記錄',
3+
createChat: '新建對話',
4+
history: '歷史記錄',
5+
only20history: '僅顯示最近 20 條對話',
6+
question_count: '條提問',
7+
exportRecords: '導出聊天記錄',
8+
chatId: '對話ID',
9+
userInput: '用戶輸入',
10+
passwordValidator: {
11+
title: '請輸入密碼打開連結',
12+
errorMessage1: '密碼不能為空',
13+
errorMessage2: '密碼錯誤'
14+
},
15+
tip: {
16+
error500Message: '抱歉,當前正在維護,無法提供服務,請稍後再試!',
17+
errorIdentifyMessage: '無法識別用戶身份',
18+
errorLimitMessage: '抱歉,您的提問已達最大限制,請明天再來吧!'
19+
},
20+
executionDetails: {
21+
title: '執行詳細',
22+
paramInput: '參數輸入',
23+
paramOutput: '參數輸出'
24+
},
25+
KnowledgeSource: {
26+
title: '知識來源',
27+
referenceParagraph: '引用分段',
28+
consume: '消耗',
29+
consumeTime: '耗時'
30+
}
31+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
export default {
2+
input_type_list: {
3+
TextInput: '文字框',
4+
Slider: '滑桿',
5+
SwitchInput: '開關',
6+
SingleSelect: '單選框',
7+
MultiSelect: '多選框',
8+
DatePicker: '日期選擇器',
9+
JsonInput: 'JSON文字框',
10+
RadioCard: '選項卡',
11+
RadioRow: '單行選項卡'
12+
},
13+
default: {
14+
label: '預設值',
15+
placeholder: '請輸入預設值',
16+
requiredMessage: '預設值 為必填屬性',
17+
show: '顯示預設值'
18+
},
19+
tip: {
20+
requiredMessage: '不能為空',
21+
jsonMessage: 'JSON格式不正確'
22+
},
23+
searchBar: {
24+
placeholder: '請輸入關鍵字搜索'
25+
},
26+
paramForm: {
27+
field: {
28+
label: '參數',
29+
placeholder: '請輸入參數',
30+
requiredMessage: '參數 為必填屬性',
31+
requiredMessage2: '只能輸入字母、數字和底線'
32+
},
33+
name: {
34+
label: '顯示名稱',
35+
placeholder: '請輸入顯示名稱',
36+
requiredMessage: '顯示名稱 為必填屬性'
37+
},
38+
tooltip: {
39+
label: '參數提示說明',
40+
placeholder: '請輸入參數提示說明'
41+
},
42+
required: {
43+
label: '是否必填',
44+
requiredMessage: '是否必填 為必填屬性'
45+
},
46+
input_type: {
47+
label: '組件類型',
48+
placeholder: '請選擇組件類型',
49+
requiredMessage: '組件類型 為必填屬性'
50+
}
51+
},
52+
DatePicker: {
53+
placeholder: '選擇日期',
54+
year: '年',
55+
month: '月',
56+
date: '日期',
57+
datetime: '日期時間',
58+
dataType: {
59+
label: '時間類型',
60+
placeholder: '請選擇時間類型'
61+
},
62+
format: {
63+
label: '格式',
64+
placeholder: '請選擇格式'
65+
}
66+
},
67+
Select: {
68+
label: '選項值',
69+
placeholder: '請輸入選項值'
70+
},
71+
tag: {
72+
label: '標籤',
73+
placeholder: '請輸入選項標籤'
74+
},
75+
Slider: {
76+
showInput: ''
77+
}
78+
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
export default {}
1+
import dynamicsForm from './dynamics-form'
2+
import chat from './ai-chat'
3+
export default {
4+
dynamicsForm,
5+
chat,
6+
noData: '無匹配資料'
7+
}

0 commit comments

Comments
 (0)