x18n README

项目的 README,来自 github.com/x18n-dev/x18n。合并为一个 markdown 文件:README.md。

x18n

x18n

Universal toolkits for linting, viewing and managing i18n for any frameworks.

x18n is the spiritual successor of i18n-ally, that generalizes its concepts into a framework-agnostic toolkit that runs everywhere with a more robust and extensible architecture.

Features

Works with your project

Keep it healthy

Built for agents and CI

Wherever you work

Usages

You can use the @x18n/cli package to check, analyze, and manage your i18n resources from the command line.

For example,

pnpx @x18n/cli

would output an overview of the i18n resources,

pnpx @x18n/cli check

would do the linting and checking of your i18n resources, reporting missing keys, or unused keys.

pnpx @x18n/cli usages nav.keys

would list all the usages of the specified key (nav.keys) across your project.

You can also run

pnpx @x18n/cli ui

to have an interactive UI in browser to manage your i18n resources easily.

Additionally, you can also install the VS Code extension for a rendering the translations directly within the editor, enabling inline translation previews, and providing rich "Go to Definition" and "Find References" support for your i18n keys.

For other editors, you can use the Language Server to enable similar features.

Packages

Package What it is
@x18n/core Engine that runs in Node and in the browser: domain model, plugin API, analysis, edits
@x18n/builtins Built-in plugins: formats, locale finders, usage scanners, checks, reporters, presets for popular i18n libraries
@x18n/node Node.js host: file system, config and plugin loading
@x18n/cli The CLI, with JSON output for CI and agents
@x18n/lsp Language server for any LSP editor
@x18n/ui devframe UI: local dev server, static report, in-browser workspace, VS Code panel, devtools panel
@x18n/devtools The UI as a panel in Vite DevTools, Nuxt DevTools and devframe hubs
x18n-vscode VS Code extension on top of the language server
x18n-zed Zed extension on top of the language server (Rust/WASM)

Credits

x18n builds on the ideas of i18n Ally and i18n Ally Next.

Sponsors

Sponsors

License

MIT License © Anthony Fu

x18n (x18n-dev/x18n)

正在搜索数据库…

744 ·GitHub
这是什么?x18n 是一套通用工具包,用于检查、查看和管理任何 Web 框架中的 i18n(国际化)资源。它是 i18n Ally 的框架无关版本后继产品。
这是一个 CLI 工具还是几个独立的工具?它是一个 monorepo,包含多个共享同一套引擎的包:核心库、Node 宿主、CLI、浏览器 UI、VS Code 扩展,以及供其他编辑器使用的 Language Server。
我该如何在项目中开始使用?安装 @x18n/cli 包,然后在项目中运行它,即可检查、分析和管理你的 i18n 资源;同一项目也可以使用 VS Code 扩展和交互式浏览器 UI。
使用前需要先安装什么吗?只需要 Node.js,因为它以 npm 包(如 @x18n/cli)的形式分发和运行;不需要 API 密钥或其他额外服务。
它是 i18n Ally 成熟的直接替代品吗?它是从头重写的,采用了全新的、扩展性更强的架构,并提供了专门的迁移路径,可以导入现有的 i18n Ally 设置;但它并不是可以无缝替换的方案。
它可以接入哪些编辑器和构建工具?除了 CLI,它还提供 VS Code 扩展,支持任何兼容 LSP 的编辑器,并可在 Vite DevTools 和 Nuxt DevTools 中添加面板。
x18n 能自动识别哪些框架?它内置了 45 个以上的零配置预设,可自动检测 Vue、React、Angular、Svelte、Astro、Next.js、Nuxt、Flutter、Laravel、Rails 和 .NET 项目。
x18n 可以读取哪些翻译文件格式?它可以解析 JSON、JSON5、YAML、PO、Fluent、INI、Properties、PHP 和 .NET 资源文件。
检查(lint/check)步骤实际能发现哪些问题?它会报告缺失、未使用和无效的键、占位符不匹配、术语表违规,以及源文本已变更但译文未同步更新的过时翻译。
x18n 是否面向 AI 编程代理使用?是的。它提供翻译和审校提示词,并支持稳定的 --json CLI 输出,便于脚本和 AI 代理在 CI 流水线中驱动它。
作者
x18n-dev
大小
14.2 MB
星标
744
时长
1个月
提交 · 90 天