@rog0x/mcp-i18n-tools
@rog0x/mcp-i18n-tools
面向 AI 代理的国际化和本地化工具,以 MCP(模型上下文协议)服务器形式提供。
工具
detect_locale
检测给定文本字符串的语言和区域设置。返回检测到的语言代码(BCP 47)、语言名称、书写系统、置信度分数(0-1)以及备选语言候选。
支持的语言: 英语、西班牙语、法语、德语、葡萄牙语、意大利语、俄语、日语、韩语、中文、阿拉伯语、印地语、泰语、希腊语、希伯来语。
extract_i18n_keys
从源代码中提取应进行国际化的硬编码用户可见字符串。可查找以下位置的字符串:
JSX/TSX 属性(
title、placeholder、label、alt、aria-label等)HTML 模板文本和属性
console.log/console.warn/console.error调用throw new Error(...)消息alert()/confirm()/prompt()对话框使用与 i18n 相关名称(
message、label、title等)的变量赋值
返回每个字符串及其行/列位置、上下文、模式类型以及建议的 i18n 键。
analyze_translations
分析翻译 JSON 文件在各区域设置之间的一致性。可检测:
缺失键 — 在参考区域设置中存在但在其他区域设置中缺失
多余键 — 在某个区域设置中存在但不在参考区域设置中
结构不匹配 — 某个键在一个区域设置中是字符串,但在另一个区域设置中是对象
插值不匹配 —
{variable}占位符在不同区域设置之间不一致空值 — 翻译为空的键
未使用的键 — 源代码中未引用的键(需要提供已使用键的列表)
plural_rules
按照 CLDR 规则为给定区域设置生成复数形式类别。显示该语言使用的复数类别,并对您提供的任何测试数字进行分类。
语言 | 类别 |
英语 | one, other |
法语 | one, other |
俄语 | one, few, many, other |
阿拉伯语 | zero, one, two, few, many, other |
波兰语 | one, few, many, other |
日语 | other |
中文 | other |
format_locale
使用 Intl API 为任何区域设置格式化数字、货币、日期和相对时间。支持:
数字 — 小数、百分比、单位;紧凑/科学/工程计数法
货币 — 符号、窄符号、代码和名称显示
日期 — 短、中、长、完整样式,含日期部分分解
相对时间 — 长、短、窄样式,支持自动数字格式化
Related MCP server: todoist
设置
npm install
npm run buildMCP 配置
{
"mcpServers": {
"i18n-tools": {
"command": "node",
"args": ["D:/products/mcp-servers/mcp-i18n-tools/dist/index.js"]
}
}
}许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Localize apps from your AI assistant: translate locale files, set glossaries, connect GitHub repos.
A Model Context Protocol server for Wix AI tools
Model Context Protocol extension for Hebrew calendar
Read Localazy projects, files, keys and glossary; submit translations, import keys, AI suggestions.
171
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to manage Xcode projects by listing targets, reading configurations, and triggering builds via the Model Context Protocol. It facilitates natural language interaction with macOS developer tools to streamline iOS app development processes.6127 npmMIT
- AlicenseNot gradedqualityFmaintenanceEnables language models to manage Todoist tasks, projects, sections, labels, comments, and collaborators through natural language via the Model Context Protocol.MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to read and write JSON translation files (i18n, i18next, react-i18next) via the Model Context Protocol.193 npm2-
- AlicenseNot gradedqualityAmaintenanceProvides internationalization MCP tools enabling AI agents to perform translations, locale management, and i18n operations.69 npmMIT