Skip to content

Commit c5585da

Browse files
committed
feat: i18n
1 parent bedbeac commit c5585da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/common/handle/impl/pdf_split_handle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
from common.handle.base_split_handle import BaseSplitHandle
2121
from common.util.split_model import SplitModel
22+
from django.utils.translation import gettext_lazy as _
2223

2324
default_pattern_list = [re.compile('(?<=^)# .*|(?<=\\n)# .*'),
2425
re.compile('(?<=\\n)(?<!#)## (?!#).*|(?<=^)(?<!#)## (?!#).*'),
@@ -274,7 +275,7 @@ def handle_links(doc, pattern_list, with_filter, limit):
274275
pre_toc[i]['content'] = re.sub(r'(?<!。)\n+', '', pre_toc[i]['content'])
275276
pre_toc[i]['content'] = re.sub(r'(?<!.)\n+', '', pre_toc[i]['content'])
276277
except BaseException as e:
277-
max_kb.info(f'此文档没有前言部分,按照普通文本处理: {e}')
278+
max_kb.error(_('This document has no preface and is treated as ordinary text: {e}').format(e=e))
278279
if pattern_list is not None and len(pattern_list) > 0:
279280
split_model = SplitModel(pattern_list, with_filter, limit)
280281
else:

0 commit comments

Comments
 (0)