A
Angular I18n MCP
作者 @ffeldhaus
An MCP server to facilitate i18n in Angular
创建于 1/9/2026
更新于 1 day ago
README
Repository documentation and setup instructions
Angular i18n MCP Server
This MCP server provides tools to manage Angular internationalization (i18n) using XLIFF 2.0 format. It integrates with ng-extract-i18n-merge to automate the extraction and merging of translation strings.
Features
- Extract i18n: Runs the Angular CLI command to extract strings and merge them into target locale files.
- List New Translations: Identifies units that are newly added and haven't been translated yet (marked with
state="initial"). - List All Translations: Provides a paginated list of all translation units.
- Update Translation: Updates the translation text for a specific unit and sets its state to
translated.
Prerequisites
- Node.js installed.
- An Angular project configured with
ng-extract-i18n-merge.ng add ng-extract-i18n-merge - Angular configuration (
angular.json) should define the target locales and use thexlf2format.
Configuration
This MCP server requires configuration in .gemini/settings.json. You can place this file in either:
- Your user home directory:
~/.gemini/settings.json - The project root directory:
./.gemini/settings.json
Add the following to your configuration:
{
"mcpServers": {
"angular-i18n": {
"command": "npx",
"args": ["-y", "angular-i18n-mcp"],
"env": {}
}
}
}
It is recommended to add src/locale to your .geminiignore file to avoid Gemini to read large translation files or attempt updates itself.
It is strongly recommended to use I18N metadata for translation to provide additional context for translators. This will allow Gemini to provide better suggestions and translations.
Tools
extract_i18n
- Extracts strings from the source code and merges them into the
.xlffiles insrc/locale.
list_new_translations
- Lists newly added translation units that haven't been translated yet (marked with
state="initial"). - Arguments:
locale: The target language code (e.g.,de).page(optional): Page number for pagination.pageSize(optional): Number of units per page.
list_all_translations
- Lists all translation units in a locale file.
- Arguments:
locale: The target language code.page(optional): Page number.pageSize(optional): Number of units per page.
update_translation
- Updates the translation text for a specific unit and sets its state to
translated. - Arguments:
id: The unique ID of the translation unit.locale: The target language code.translation: The new translated text.
快速设置
此服务器的安装指南
安装包 (如果需要)
npx @modelcontextprotocol/server-angular-i18n-mcp
Cursor 配置 (mcp.json)
{
"mcpServers": {
"ffeldhaus-angular-i18n-mcp": {
"command": "npx",
"args": [
"ffeldhaus-angular-i18n-mcp"
]
}
}
}