diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 452ded1c..549bfaea 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -49,9 +49,11 @@ jobs: echo "Files to translate:" echo "${{ steps.changed-files.outputs.files }}" - for file in ${{ steps.changed-files.outputs.files }}; do - echo "Translating $file..." - python tools/translate/main.py "$file" "$DIFY_API_KEY" + echo "${{ steps.changed-files.outputs.files }}" | while IFS= read -r file; do + if [[ -n "$file" ]]; then + echo "Translating $file..." + python tools/translate/main.py "$file" "$DIFY_API_KEY" + fi done - name: Commit and push changes diff --git a/zh-hans/test.mdx b/zh-hans/test.mdx deleted file mode 100644 index 0cddee5b..00000000 --- a/zh-hans/test.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: 测试 ---- -# 测试 -你好,时间 -这是一个测试文件。 \ No newline at end of file diff --git a/zh-hans/test2.mdx b/zh-hans/test2.mdx deleted file mode 100644 index 36aabd43..00000000 --- a/zh-hans/test2.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: 测试文档 2 ---- -你好,世界! -这是一个测试文档 2! \ No newline at end of file diff --git a/zh-hans/test3.mdx b/zh-hans/test3.mdx new file mode 100644 index 00000000..f510968a --- /dev/null +++ b/zh-hans/test3.mdx @@ -0,0 +1,25 @@ +--- +title: 测试文档 +--- + +# 测试文档 +这是一个测试文档,用于验证翻译功能。 + +--- + +对于文档撰写者: + +GitHub Actions 仅用作观测进展. 实际操作是: + +1. 写文档 +2. push +3. 等待大约 0.5 - 1 分钟 +4. pull request + 1. 或者在 GitHub 网页上查看提交记录 + +没了 + +--- + +如果要更新术语表, 请更新 `tools/translate/termbase_i18n.md` +如果要调整翻译用的 prompt 或者更换基座模型, 访问我们的 Dify Studio 即可.