
I18n
io.github.rog0x由 GitHub 账号 rog0x 发布v1.0.2更新于 Oct 24, 2026
Locale detect, translations, plurals for AI agents
概览
本地 MCP 服务器,为助手提供国际化工具:语言区域检测、i18n 键提取、翻译文件检查、复数规则和区域格式化。
- 可以做什么
- 提供五个本地化相关工具。detect_locale 识别文本字符串的语言和区域,返回 BCP 47 代码、书写文字、置信度和候选语言。extract_i18n_keys 在源代码中查找硬编码的面向用户字符串,例如 JSX 属性、HTML 文本、console 调用、抛出的错误、对话框以及带 i18n 相关名称的变量,并给出行列位置和建议的键名。analyze_translations 比较各区域的翻译 JSON 文件,检查缺失、多余、未使用或为空的键,以及结构和插值不匹配。plural_rules 返回 CLDR 复数类别,format_locale 格式化数字、货币、日期和相对时间。
- 适用场景
- 适合助手协助本地化工作的场景:审查代码库中的硬编码字符串、检查各区域翻译文件之间的差异,或生成正确的复数形式以及符合区域习惯的数字、货币和日期格式。
- 运行要求
- 作为 Node.js 进程通过 stdio 在本地运行,从 npm 包 @rog0x/mcp-i18n-tools 安装;README 展示了构建方式,并让客户端指向构建后的 dist/index.js 文件。未声明身份验证、环境变量或请求头。仅支持桌面端,无网页可执行版本。
安装
在 SourceWeft 中
- 打开 控制台中的 I18n,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@rog0x/mcp-i18n-tools
Internationalization and localization tools for AI agents, exposed as an MCP (Model Context Protocol) server.
Tools
detect_locale
Detect the language and locale of a given text string. Returns the detected language code (BCP 47), language name, writing script, confidence score (0-1), and alternate language candidates.
Supported languages: English, Spanish, French, German, Portuguese, Italian, Russian, Japanese, Korean, Chinese, Arabic, Hindi, Thai, Greek, Hebrew.
extract_i18n_keys
Extract hardcoded user-facing strings from source code that should be internationalized. Finds strings in:
- JSX/TSX attributes (
title,placeholder,label,alt,aria-label, etc.) - HTML template text and attributes
console.log/console.warn/console.errorcallsthrow new Error(...)messagesalert()/confirm()/prompt()dialogs- Variable assignments with i18n-relevant names (
message,label,title, etc.)
Returns each string with its line/column, surrounding context, pattern type, and a suggested i18n key.
analyze_translations
Analyze translation JSON files for consistency across locales. Detects:
- Missing keys — present in reference locale but absent in others
- Extra keys — present in a locale but not in the reference
- Structure mismatches — a key is a string in one locale but an object in another
- Interpolation mismatches —
{variable}placeholders differ between locales - Empty values — keys with blank translations
- Unused keys — keys not referenced in source code (requires a list of used keys)
plural_rules
Generate plural form categories for a given locale following CLDR rules. Shows which plural categories the language uses and classifies any test numbers you provide.
format_locale
Format numbers, currencies, dates, and relative times for any locale using the Intl APIs. Supports:
- Numbers — decimal, percent, unit; compact/scientific/engineering notation
- Currency — symbol, narrowSymbol, code, and name displays
- Dates — short, medium, long, full styles with date parts breakdown
- Relative time — long, short, narrow styles with auto-numeric formatting
Setup
MCP Configuration
License
MIT
来源:README.md,提交 734ad18
工具
0版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。