-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 新增翻译任务,将系统文档翻译成英文、日文和朝鲜语 - 在 CI 工作流中添加翻译步骤,使用 GPT-4 和其他模型进行翻译 - 更新 README-zh.md,对文档进行修订和合并 - 新增 copy.js 脚本,用于复制 Markdown 文件 - 添加系统和翻译文档,为 AI 翻译提供指导
- Loading branch information
Showing
9 changed files
with
586 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,10 +64,13 @@ jobs: | |
- name: Test | ||
run: | | ||
pnpm test || (echo "Test failed" && exit 1) | ||
mkdir -p translate | ||
node ./dist/index.js -i ./src/system.md -o ./translate/system-gpt-4o-en.md -l English --openai-url https://models.inference.ai.azure.com/chat/completions --api-key ${{ secrets.OPENAI_API_KEY }} --model gpt-4o | ||
node ./dist/index.js -i ./src/system.md -o ./translate/system-ministral-3b-ja.md -l Japanese --openai-url https://models.inference.ai.azure.com/chat/completions --api-key ${{ secrets.OPENAI_API_KEY }} --model Ministral-3B | ||
node ./dist/index.js -i ./src/system.md -o ./translate/system-phi-3.5-mini-instruct-ko.md -l 朝鲜语 --openai-url https://models.inference.ai.azure.com/chat/completions --api-key ${{ secrets.OPENAI_API_KEY }} --model Phi-3.5-mini-instruct | ||
- name: Commit and Push | ||
run: | | ||
git add README-zh.md | ||
git add README-zh.md translate/ | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git config advice.ignoredHook false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
// 将 import.meta.url 转换为文件路径 | ||
const __filename = fileURLToPath(import.meta.url); // 当前脚本的文件路径 | ||
const __dirname = path.dirname(__filename); // 当前文件所在目录 | ||
|
||
const srcDir = path.join(__dirname, '../src'); // 源文件目录 | ||
const distDir = path.join(__dirname, '../dist'); // 目标文件目录 | ||
|
||
// 检查目标目录是否存在,如果不存在则创建 | ||
if (!fs.existsSync(distDir)) { | ||
fs.mkdirSync(distDir, { recursive: true }); // 递归创建目标目录 | ||
} | ||
|
||
// 遍历 src 目录下的所有 Markdown 文件 | ||
const files = fs.readdirSync(srcDir); | ||
files.forEach((file) => { | ||
const filePath = path.join(srcDir, file); | ||
|
||
// 检查是否是 .md 文件 | ||
if (path.extname(file) === '.md') { | ||
const destPath = path.join(distDir, file); // 目标文件路径 | ||
|
||
// 复制文件 | ||
fs.copyFileSync(filePath, destPath); | ||
console.log(`已复制文件 ${file} 到 ${distDir}`); | ||
} | ||
}); |
Oops, something went wrong.