Files
AllinSSL/frontend/packages/vue/vite/plugin/index.ts
chudong d147bc7a82 【修复】条件节点前fromNodeId传值问题
【修复】部署参数默认错误问题
【测设】部分项目代码结构
【同步】前端项目代码
2025-05-09 18:44:33 +08:00

28 lines
976 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 如果你想自定义翻译处理
import { Scanner, Translator, TranslationQueue, FileManager } from "./i18n";
async function customTranslation() {
const config = {
scanDirs: ["src"], // 需要扫描的目录
fileTypes: [".vue", ".tsx", ".jsx", ".ts", ".js"], // 支持的文件类型
targetLanguages: ["en", "zh"], // 目标语言
outputDir: "src/locales", // 输出目录
glmConfig: {
apiKey: "a160afdbea1644e68de5e5b014bea0f7.zZuSidvDSYOD7oJT", // 你的智谱 AI API 密钥
apiEndpoint: "https://open.bigmodel.cn/api/paas/v4/chat/completions", // 可选API 端点
},
};
const scanner = new Scanner(config);
const translator = new Translator(config);
const queue = new TranslationQueue();
const fileManager = new FileManager(config);
// 自定义扫描和翻译逻辑
const results = await scanner.scanFiles();
// ... 处理翻译
await fileManager.generateI18nFiles(queue.getAll());
}
customTranslation();