# ai-i18n > Vite AI 国际化插件 ## 文档 - [Vanilla 快速上手](https://bosens-china.github.io/ai-i18n/guide/getting-started/vanilla.md): 在 Vite Vanilla TypeScript 项目中安装 ai-i18n 并完成首次翻译 - [Vue 快速上手](https://bosens-china.github.io/ai-i18n/guide/getting-started/vue.md): 从 create-vite 创建 Vue 3 项目,并完成 ai-i18n 配置、翻译与 Build 验证 - [React 快速上手](https://bosens-china.github.io/ai-i18n/guide/getting-started/react.md): 从 create-vite 创建 React 项目,并完成 ai-i18n 配置、翻译与 Build 验证 - [通用文案写法](https://bosens-china.github.io/ai-i18n/guide/basic/static-analysis/common.md): 使用 ai-i18n 翻译文案、动态值和文案集合 - [Vue 文案写法](https://bosens-china.github.io/ai-i18n/guide/basic/static-analysis/vue.md): 在 Vue SFC、Options API 和 template 中直接使用 t() - [React 文案写法](https://bosens-china.github.io/ai-i18n/guide/basic/static-analysis/react.md): 在 React 组件中使用 useI18n() 翻译并响应语言切换 - [自动导入](https://bosens-china.github.io/ai-i18n/guide/basic/auto-import.md): 显式开启 ai-i18n 自动导入,并按框架模式配置 Runtime API 与 ESLint - [语言分包与按需加载](https://bosens-china.github.io/ai-i18n/guide/basic/locale-loading.md): 使用 loading 按 locale 拆分 Vite chunk,并在切换语言时展示加载状态 - [生成文件与 Git](https://bosens-china.github.io/ai-i18n/guide/basic/directory.md): 了解 ai-i18n 生成的文件、提交规则,以及何时运行完整 Build - [补译与审校](https://bosens-china.github.io/ai-i18n/guide/basic/translations.md): 补齐缺失译文、人工确认用词,并在提交前验证结果 - [TypeScript 与生成声明](https://bosens-china.github.io/ai-i18n/guide/quality/typescript.md): 接入 ai-i18n 生成声明,并排查虚拟模块、自动导入和 Vue template 类型问题 - [ESLint](https://bosens-china.github.io/ai-i18n/guide/quality/eslint.md): 安装 ai-i18n ESLint 插件,并按项目的导入方式启用推荐规则 - [ESLint 规则参考](https://bosens-china.github.io/ai-i18n/guide/quality/eslint-rules.md): 按需调整 ai-i18n ESLint 规则、自动导入和项目路径解析 - [测试(Vitest)](https://bosens-china.github.io/ai-i18n/guide/quality/testing.md): 使用 aiI18nVitest() 测试使用 ai-i18n 的业务代码,无需手写 alias 或 mock - [AI 翻译](https://bosens-china.github.io/ai-i18n/guide/advanced/ai-translation.md): 使用 OpenAI-compatible Provider 自动补齐缺失译文 - [LLM 日志与排障](https://bosens-china.github.io/ai-i18n/guide/advanced/llm-logs.md): 启用并阅读 OpenAI Provider 审查日志,用 batchId 定位翻译链路问题 - [Translation Memory](https://bosens-china.github.io/ai-i18n/guide/advanced/translation-memory.md): 选择分片 JSON 或全局 SQLite,并控制 Provider 的进程级刷新 - [使用 Agent 补译](https://bosens-china.github.io/ai-i18n/guide/advanced/ai-tools.md): 为 AI 编码工具配置 Skills 和 MCP,按项目语境补齐缺失译文 - [通用常见问题](https://bosens-china.github.io/ai-i18n/guide/faq/common.md): 排查 ai-i18n 的安装兼容性、SSR、Dev 提取、语言加载与生成文件问题 - [Vue 常见问题](https://bosens-china.github.io/ai-i18n/guide/faq/vue.md): 排查 Vue 模板提取、语言切换更新、自动导入与 tRef 使用问题 - [React 常见问题](https://bosens-china.github.io/ai-i18n/guide/faq/react.md): 排查 React JSX 提取、语言切换订阅、顶层 t 与 React Compiler 问题 ## API - [API 总览](https://bosens-china.github.io/ai-i18n/api/index.md): 按导入入口与符号类型查找 ai-i18n 的公开 API - [aiI18n()](https://bosens-china.github.io/ai-i18n/api/vite/functions/ai-i18n.md): 创建 ai-i18n 的 Vite 插件 - [AiI18nOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/ai-i18n-options.md): aiI18n() 的顶层配置接口 - [AiI18nPersistOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/ai-i18n-persist-options.md): 配置语言偏好的 localStorage key - [AiI18nLocaleLoadingOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/ai-i18n-locale-loading-options.md): 配置目标语言的分包与资源提示 - [AiI18nTranslationMemoryCapacityOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/ai-i18n-translation-memory-capacity-options.md): 限制当前项目历史 Translation Memory 的容量 - [AiI18nCleanupOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/ai-i18n-cleanup-options.md): 配置生成文件和历史译文的清理策略 - [AiI18nTranslationMemoryOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/ai-i18n-translation-memory-options.md): 选择 Translation Memory 存储 - [HtmlExtractorOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/html-extractor-options.md): 配置 index.html 中需要提取的属性 - [LangOption](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/lang-option.md): 描述语言标识和展示名称 - [TranslationOptions](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/translation-options.md): 为静态文案补充翻译语境 - [TranslationMessage](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/translation-message.md): Translator 接收的单条源文案与语境 - [TranslationBatch](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/translation-batch.md): Translator 单次调用接收的语言和消息批次 - [TranslationBatchEvent](https://bosens-china.github.io/ai-i18n/api/vite/interfaces/translation-batch-event.md): Translator 批次的旁路诊断事件 - [AiI18nProviderOptions](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/ai-i18n-provider-options.md): 定义 Translator 的缓存、批次、并发与失败策略 - [AiI18nFramework](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/ai-i18n-framework.md): ai-i18n 支持的 Vite 框架模式 - [LangLoadState](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/lang-load-state.md): Runtime 的语言资源加载状态快照 - [MessageTree](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/message-tree.md): 可一次翻译的静态纯文案对象或数组 - [TranslatedMessageTree](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/translated-message-tree.md): 保持文案树结构的翻译结果类型 - [Translator](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/translator.md): ai-i18n 的自定义翻译函数契约 - [TranslationResult](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/translation-result.md): Translator 为一条消息返回的目标语言矩阵行 - [TranslationBatchStage](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/translation-batch-stage.md): Translator 批次诊断阶段 - [TranslationLogging](https://bosens-china.github.io/ai-i18n/api/vite/type-aliases/translation-logging.md): Translator 批次接收的日志关闭状态或已解析目录 - [aiI18nVitest()](https://bosens-china.github.io/ai-i18n/api/vitest/functions/ai-i18n-vitest.md): 为 Vitest 提供内存 Runtime 与编译宏转换 - [AiI18nVitestOptions](https://bosens-china.github.io/ai-i18n/api/vitest/type-aliases/ai-i18n-vitest-options.md): aiI18nVitest() 接受的配置子集 - [Runtime 概览](https://bosens-china.github.io/ai-i18n/api/runtime/overview.md): virtual:ai-i18n 的导入方式与框架可用范围 - [t()](https://bosens-china.github.io/ai-i18n/api/runtime/functions/t.md): 翻译静态文案、文案树或带动态值的模板字符串 - [setLang()](https://bosens-china.github.io/ai-i18n/api/runtime/functions/set-lang.md): 加载并切换当前语言 - [getLang()](https://bosens-china.github.io/ai-i18n/api/runtime/functions/get-lang.md): 返回 Runtime 当前使用的语言 - [getLangs()](https://bosens-china.github.io/ai-i18n/api/runtime/functions/get-langs.md): 返回配置的语言列表快照 - [getLangLoadState()](https://bosens-china.github.io/ai-i18n/api/runtime/functions/get-lang-load-state.md): 读取当前语言资源加载状态快照 - [subscribe()](https://bosens-china.github.io/ai-i18n/api/runtime/functions/subscribe.md): 订阅 Runtime 的语言和模块更新 - [Vue useI18n()](https://bosens-china.github.io/ai-i18n/api/runtime/vue/use-i18n.md): 在 Vue 组件中读取共享的响应式语言状态与切换 action - [tRef()](https://bosens-china.github.io/ai-i18n/api/runtime/vue/t-ref.md): 在 Vue setup 中创建随语言变化更新的只读翻译 Ref - [i18nComputed()](https://bosens-china.github.io/ai-i18n/api/runtime/vue/i18n-computed.md): 为纯 Options API 组件提供响应式语言和加载状态 - [tComputed()](https://bosens-china.github.io/ai-i18n/api/runtime/vue/t-computed.md): 为纯 Options API 创建响应式翻译 computed getter - [React useI18n()](https://bosens-china.github.io/ai-i18n/api/runtime/react/use-i18n.md): 在 React 组件中订阅 Runtime,并响应语言和语言包状态变化 - [defineI18nMessages()](https://bosens-china.github.io/ai-i18n/api/runtime/macros/define-i18n-messages.md): 声明可被静态分析器枚举的消息集合 - [openAI()](https://bosens-china.github.io/ai-i18n/api/openai/functions/open-ai.md): 创建 OpenAI-compatible Translator - [OpenAIOptions](https://bosens-china.github.io/ai-i18n/api/openai/interfaces/open-ai-options.md): openAI() 的模型、请求与提示词配置 - [LangSmithOptions](https://bosens-china.github.io/ai-i18n/api/openai/interfaces/lang-smith-options.md): 配置 OpenAI Provider 的 LangSmith tracing ## 演示 - [Vue 3 示例](https://bosens-china.github.io/ai-i18n/demo/vue.md): 对照体验 script setup 与纯 Options API 的完整 Vue 能力 - [React 示例](https://bosens-china.github.io/ai-i18n/demo/react.md): 嵌入 React 示例应用,直观体验语言切换与文案更新 - [Vanilla JS 示例](https://bosens-china.github.io/ai-i18n/demo/vanilla.md): 嵌入 Vanilla 示例应用,直观体验语言切换与文案更新