This commit is contained in:
parent
2ca2a0935b
commit
a533c1b7e0
20
.github/workflows/翻译更新日志 copy.yml
vendored
20
.github/workflows/翻译更新日志 copy.yml
vendored
@ -81,19 +81,15 @@ jobs:
|
||||
|
||||
# 4. 创建中英文对照的更新日志,使用markdown格式的表格展示
|
||||
- name: 生成中英文对照的更新日志
|
||||
env:
|
||||
ENGLISH_TEXT: ${{ steps.fetch_commits.outputs.messages }}
|
||||
CHINESE_TEXT: ${{ steps.translate.outputs.translated_text }}
|
||||
run: |
|
||||
# 使用四个空格缩进英文和中文内容,确保 Markdown 表格格式显示正确
|
||||
cat <<EOF > ./更新日志对照表格.md
|
||||
| 英文原文 | 中文翻译 |
|
||||
| --- | --- |
|
||||
|
|
||||
$ENGLISH_TEXT
|
||||
|
|
||||
$CHINESE_TEXT
|
||||
EOF
|
||||
# 处理英文原文和中文翻译中的换行符为 `<br>`
|
||||
ENGLISH_TEXT=$(echo "${{ steps.fetch_commits.outputs.messages }}" | sed ':a;N;$!ba;s/\n/<br>/g')
|
||||
CHINESE_TEXT=$(echo "${{ steps.translate.outputs.translated_text }}" | sed ':a;N;$!ba;s/\n/<br>/g')
|
||||
|
||||
# 创建 Markdown 表格
|
||||
echo "| 英文原文 | 中文翻译 |" > ./更新日志对照表格.md
|
||||
echo "| --- | --- |" >> ./更新日志对照表格.md
|
||||
echo "| $ENGLISH_TEXT | $CHINESE_TEXT |" >> ./更新日志对照表格.md
|
||||
|
||||
# 输出表格内容,方便调试
|
||||
cat ./更新日志对照表格.md
|
Loading…
Reference in New Issue
Block a user