多语言本地化翻译工具

多语言本地化翻译工具

一个简单的翻译MCP Server,可以实现单文件或者目录翻译能力,仅支持JSON数据(JSON,JS,TS格式),根据文件名称自动截取翻译的目标语言,完成自动化处理。

vlinr

Developer Tools
Visit Server

README

多语言本地化翻译工具

这是一个基于大语言模型的本地化翻译工具,可以自动处理并翻译各种本地化文件(.ts、.js、.json)中的文本内容。

功能特点

  1. 支持多种文件格式

    • TypeScript (.ts)
    • JavaScript (.js)
    • JSON (.json)
  2. 智能文件处理

    • 自动识别文件中的语言代码(如:en-US, zh-CN)
    • 自动备份原始文件
    • 保持源文件格式和结构
  3. 高效批处理

    • 支持整个目录的批量处理
    • 自动创建输出目录结构
    • 并发处理多个文件
    • 支持单文件处理
  4. 安全特性

    • 自动文件备份
    • 错误处理和日志记录
    • 格式验证和清理

使用说明

文件命名规范

翻译文件需要在文件名中包含语言代码,例如:

  • messages.en-US.ts
  • translations.zh-CN.json

支持的语言代码格式:

  • xx-XX(如:zh-CN, en-US)
  • xx-xx(如:zh-cn, en-us)

Cursor 配置说明

  1. 打开 Cursor 设置
  2. 找到 MCP 配置
  3. 根据操作系统输入对应配置:

Mac 用户

{
  "mcpServers": {
    "transform": {
      "command": "node",
      "args": [
        "{\"apiKey\":\"你的API密钥\",\"modelName\":\"你使用的模型名称\",\"baseUrl\":\"API基础URL\"}"
      ]
    }
  }
}

Windows 用户

{
  "mcpServers": {
    "transform": {
      "command": "cmd",
      "args": [
        "/c",
        "node",
        "{\"apiKey\":\"你的API密钥\",\"modelName\":\"你使用的模型名称\",\"baseUrl\":\"API基础URL\"}"
      ]
    }
  }
}

注意事项

  1. 文件处理

    • 处理前会自动备份原文件
    • 备份文件格式:原文件名.backup.时间戳.扩展名
    • 跳过不符合命名规范的文件
  2. 错误处理

    • 单个文件处理失败不会影响其他文件
    • 控制台会输出处理状态和错误信息
  3. 性能优化

    • 大文件会自动分块处理
    • 默认每块最大处理 500 个键值对
    • 并发处理多个文件提高效率
  4. 路径问题

    • 请使用绝对路径,相对路径会查找代码执行位置

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python