Skip to content

Commit 3ed9307

Browse files
committed
fix: Knowledge base export error
1 parent 5772b02 commit 3ed9307

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

apps/dataset/serializers/document_serializers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
delete_embedding_by_document, update_embedding_dataset_id, delete_embedding_by_paragraph_ids, \
6464
embedding_by_document_list
6565
from smartdoc.conf import PROJECT_DIR
66-
from django.utils.translation import gettext_lazy as _
66+
from django.utils.translation import gettext_lazy as _, gettext
6767

6868
parse_qa_handle_list = [XlsParseQAHandle(), CsvParseQAHandle(), XlsxParseQAHandle(), ZipParseQAHandle()]
6969
parse_table_handle_list = [CsvSplitTableHandle(), XlsSplitTableHandle(), XlsxSplitTableHandle()]
@@ -631,9 +631,9 @@ def get_workbook(data_dict, document_dict):
631631
# 添加工作表
632632
worksheet = workbook.create_sheet(document_dict.get(sheet_id))
633633
data = [
634-
[_('Section title (optional)',
635-
'Section content (required, question answer, no more than 4096 characters)',
636-
'Question (optional, one per line in the cell)')],
634+
[gettext('Section title (optional)'),
635+
gettext('Section content (required, question answer, no more than 4096 characters)'),
636+
gettext('Question (optional, one per line in the cell)')],
637637
*data_dict.get(sheet_id, [])
638638
]
639639
# 写入数据到工作表

apps/locales/en_US/LC_MESSAGES/django.po

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-01-22 15:58+0800\n"
11+
"POT-Creation-Date: 2025-01-22 18:19+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -144,7 +144,7 @@ msgid "message type error"
144144
msgstr ""
145145

146146
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177
147-
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:222
147+
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:221
148148
msgid ""
149149
"Sorry, the AI model is not configured. Please go to the application to set "
150150
"up the AI model first."
@@ -2811,6 +2811,15 @@ msgstr ""
28112811
msgid "Section title (optional)"
28122812
msgstr ""
28132813

2814+
#: .\apps\dataset\serializers\document_serializers.py:635
2815+
msgid ""
2816+
"Section content (required, question answer, no more than 4096 characters)"
2817+
msgstr ""
2818+
2819+
#: .\apps\dataset\serializers\document_serializers.py:636
2820+
msgid "Question (optional, one per line in the cell)"
2821+
msgstr ""
2822+
28142823
#: .\apps\dataset\serializers\document_serializers.py:735
28152824
msgid "The task is being executed, please do not send it repeatedly."
28162825
msgstr ""
@@ -3647,7 +3656,7 @@ msgid ""
36473656
"sketch, flat illustration, two-dimensional, and 3D. Cartoon."
36483657
msgstr ""
36493658

3650-
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:94
3659+
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:95
36513660
msgid "Alibaba Cloud Bailian"
36523661
msgstr ""
36533662

apps/locales/zh_CN/LC_MESSAGES/django.po

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-01-22 15:44+0800\n"
11+
"POT-Creation-Date: 2025-01-22 18:18+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -144,7 +144,7 @@ msgid "message type error"
144144
msgstr "消息类型错误"
145145

146146
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177
147-
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:222
147+
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:221
148148
msgid ""
149149
"Sorry, the AI model is not configured. Please go to the application to set "
150150
"up the AI model first."
@@ -2817,6 +2817,15 @@ msgstr "文档 id 不存在"
28172817
msgid "Section title (optional)"
28182818
msgstr "分段标题(选填)"
28192819

2820+
#: .\apps\dataset\serializers\document_serializers.py:635
2821+
msgid ""
2822+
"Section content (required, question answer, no more than 4096 characters)"
2823+
msgstr "分段内容(必填,问题答案,最长不超过4096个字符)"
2824+
2825+
#: .\apps\dataset\serializers\document_serializers.py:636
2826+
msgid "Question (optional, one per line in the cell)"
2827+
msgstr "问题(选填,单元格内一行一个)"
2828+
28202829
#: .\apps\dataset\serializers\document_serializers.py:735
28212830
msgid "The task is being executed, please do not send it repeatedly."
28222831
msgstr "任务正在执行中,请勿重复发送"
@@ -3663,7 +3672,7 @@ msgstr ""
36633672
"或者参考风格迁移,重点风格包括但不限于水彩、油画、中国画、素描、扁平插画、二"
36643673
"次元、3D卡通。"
36653674

3666-
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:94
3675+
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:95
36673676
msgid "Alibaba Cloud Bailian"
36683677
msgstr "阿里云百炼"
36693678

@@ -6753,4 +6762,4 @@ msgstr "删除个人系统 API_KEY"
67536762
#: .\apps\xpack\views\system_api_key_views.py:57
67546763
#: .\apps\xpack\views\system_api_key_views.py:58
67556764
msgid "Add personal system API_KEY"
6756-
msgstr "添加个人系统 API_KEY"
6765+
msgstr "添加个人系统 API_KEY"

apps/locales/zh_Hant/LC_MESSAGES/django.po

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-01-22 15:57+0800\n"
11+
"POT-Creation-Date: 2025-01-22 18:20+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -145,7 +145,7 @@ msgid "message type error"
145145
msgstr "消息類型錯誤"
146146

147147
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177
148-
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:222
148+
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:221
149149
msgid ""
150150
"Sorry, the AI model is not configured. Please go to the application to set "
151151
"up the AI model first."
@@ -2818,6 +2818,15 @@ msgstr "文檔 id 不存在"
28182818
msgid "Section title (optional)"
28192819
msgstr "分段標題(選填)"
28202820

2821+
#: .\apps\dataset\serializers\document_serializers.py:635
2822+
msgid ""
2823+
"Section content (required, question answer, no more than 4096 characters)"
2824+
msgstr "分段內容(必填,問題答案,最長不超過4096個字元)"
2825+
2826+
#: .\apps\dataset\serializers\document_serializers.py:636
2827+
msgid "Question (optional, one per line in the cell)"
2828+
msgstr "問題(選填,儲存格內一行一個)"
2829+
28212830
#: .\apps\dataset\serializers\document_serializers.py:735
28222831
msgid "The task is being executed, please do not send it repeatedly."
28232832
msgstr "任務正在執行中,請勿重複發送"
@@ -3664,7 +3673,7 @@ msgstr ""
36643673
"或者參考風格遷移,重點風格包括但不限於水彩、油畫、中國畫、素描、扁平插畫、二"
36653674
"次元、3D卡通。"
36663675

3667-
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:94
3676+
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:95
36683677
msgid "Alibaba Cloud Bailian"
36693678
msgstr "阿里雲百鍊"
36703679

0 commit comments

Comments
 (0)