Skip to content

Commit 96f4abd

Browse files
committed
fix(docs): 更新FAQ和高级文档,修正文件不存在的提示信息,优化命令行示例和参数描述
1 parent 4ab00c1 commit 96f4abd

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

docs/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ I want to use some of the features of the latest version, how do I update it?
3030
`pip install -U pdf2zh`
3131

3232

33-
## The following files do not exist: example.pdf / 以下文件不存在: example.pdf
33+
## The following files do not exist: example.pdf / 以下文件不存在example.pdf
3434
- **Issue / 问题**:
3535
When executing the program, users would have the following outputs: `The following files do not exist: example.pdf` if the document was not found.
3636
当执行程序时,如果找不到文档,用户将会看到以下输出:`The following files do not exist: example.pdf`

docs/advanced/advanced.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
Execute the translation command in the command line to generate the translated document `example-mono.pdf` and the bilingual document `example-dual.pdf` in the current working directory. Use Google as the default translation service. More support translation services can find [HERE](https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#services).
2525

2626
<img src="./../images/cmd_light.png" width="580px" alt="cmd"/>
27-
<!-- TODO 把命令行图片换掉 主命令部分黑色不透明 参数部分75透 颜色参考 https://developer.apple.com/design/human-interface-guidelines/color#iOS-iPadOS-system-colors -->
27+
<!-- TODO 把命令行图片换掉 主命令部分黑色不透明 参数部分 75 透 颜色参考 https://developer.apple.com/design/human-interface-guidelines/color#iOS-iPadOS-system-colors -->
2828

2929
In the following table, we list all advanced options for reference:
3030

3131
##### Args
32-
<!-- TODO 把2.0版本不支持的短参数改掉 -->
32+
<!-- TODO 把 2.0 版本不支持的短参数改掉 -->
3333
| Option | Function | Example |
3434
|------------------------------------|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
3535
| `files` | Local PDF file path | `pdf2zh ~/local.pdf` |

docs/community/Contribution-Guide.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
> [!CAUTION]
44
>
5-
> 当前本项目维护者正在研究文档自动国际化,故不接受任何与文档国际化/文档翻译相关的PR
5+
> 当前本项目维护者正在研究文档自动国际化,故不接受任何与文档国际化/文档翻译相关的 PR
66
>
7-
> 请勿提交与文档国际化/文档翻译相关的PR
7+
> 请勿提交与文档国际化/文档翻译相关的 PR
88
99
感谢您对本项目的兴趣!在您开始贡献之前,请花一些时间阅读以下指南,确保您的贡献能够顺利被接受。
1010

11+
## 不接受的贡献类型
12+
13+
1. 文档国际化/文档翻译
14+
2. 与基础架构有关的贡献,如 HTTP API 等。
15+
3. 明确标出 No help needed 的 Issue。
16+
4. 其他维护者认为不合适的贡献。
17+
18+
请勿提交与上述类型相关的 PR。
19+
1120
## 提交流程
1221

1322
1. Fork 本仓库并克隆到本地。
@@ -24,7 +33,7 @@
2433

2534
> [!TIP]
2635
>
27-
> 您无需等到完全开发完成再创建PR,可以尽早创建,方便我们查看您的实现并提供建议。
36+
> 您无需等到完全开发完成再创建 PR,可以尽早创建,方便我们查看您的实现并提供建议。
2837
>
2938
> 如果您对源代码或相关事宜有任何疑问,请联系维护者 [email protected]
3039
>
@@ -64,11 +73,11 @@
6473
>
6574
> 当前正处于 pdf2zh 2.0 过渡期中:
6675
>
67-
> 现有 PDF 翻译后端将逐渐弃用,之后本项目将主要负责解决 [BabelDOC](https://github.com/funstory-ai/BabelDOC) 自部署+更多翻译器支持。详情参照 [pdf2zh 2.0 roadmap](https://github.com/Byaidu/PDFMathTranslate/issues/586)
76+
> 现有 PDF 翻译后端将逐渐弃用,之后本项目将主要负责解决 [BabelDOC](https://github.com/funstory-ai/BabelDOC) 自部署 + 更多翻译器支持。详情参照 [pdf2zh 2.0 roadmap](https://github.com/Byaidu/PDFMathTranslate/issues/586)
6877
>
6978
> 我们不接受针对现有 PDF 翻译后端的功能请求,如果您对 PDF 翻译有功能需求,请给 [BabelDOC](https://github.com/funstory-ai/BabelDOC) 发 issue。
7079
>
71-
> 同时,在过渡期间,维护负担较小的PR会被合并。对于诸如配置系统、http api等较大的任务,维护者想自行完成。如果您对相关事宜有任何疑问,欢迎联系维护者 [email protected]
80+
> 同时,在过渡期间,维护负担较小的 PR 会被合并。对于诸如配置系统、http api 等较大的任务,维护者想自行完成。如果您对相关事宜有任何疑问,欢迎联系维护者 [email protected]
7281
7382
## 添加翻译接口
7483

pdf2zh/gui.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,12 @@
220220
available_services = [x.translate_engine_type for x in TRANSLATION_ENGINE_METADATA]
221221

222222
if settings.gui_settings.enabled_services:
223-
enabled_services = set(x.lower() for x in settings.gui_settings.enabled_services.split(","))
224-
available_services = [x for x in available_services if x.lower() in enabled_services]
223+
enabled_services = {
224+
x.lower() for x in settings.gui_settings.enabled_services.split(",")
225+
}
226+
available_services = [
227+
x for x in available_services if x.lower() in enabled_services
228+
]
225229

226230
assert available_services, "No translation service is enabled"
227231

0 commit comments

Comments
 (0)