MCP cover image
See in Github
2025-03-27

一个简单的翻译mcp服务器,可以实现单文件或者目录翻译能力

1

Github Watches

0

Github Forks

0

Github Stars

多语言本地化翻译工具

这是一个基于大语言模型的本地化翻译工具,可以自动处理并翻译各种本地化文件(.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. 路径问题

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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • modelcontextprotocol
  • 模型上下文协议服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

    Reviews

    5 (1)
    Avatar
    user_c6PDdHii
    2025-04-16

    Translate-server by vlinr is an impressive tool for seamless language translation. Easy to integrate with any application, it offers fast and accurate translations, making communication across languages effortless. The open-source nature and comprehensive documentation on GitHub ensure that developers can customize and extend its functionality to suit specific needs. Highly recommend it for anyone looking to add translation services to their app!