chatgpt-md-translator  by smikitky

CLI tool for translating Markdown documents using the ChatGPT API

created 2 years ago
313 stars

Top 87.4% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This CLI tool translates Markdown documentation using the OpenAI ChatGPT API, targeting developers and technical writers who need to localize open-source project documentation. It offers fine-grained control over translation quality and cost by leveraging ChatGPT's understanding of technical content and Markdown structure.

How It Works

The tool processes Markdown files by splitting them into manageable fragments, sending each fragment to the ChatGPT API with a user-defined prompt. This approach allows for parallel processing of fragments, potentially speeding up translation for large documents. It includes features like code block preservation and configurable fragment sizes to optimize API usage and maintain translation consistency.

Quick Start & Requirements

  • Install globally: npm install --global chatgpt-md-translator
  • Requires Node.js.
  • OpenAI API key is mandatory.
  • Configuration via .env file or command-line overrides.
  • Prompt file (prompt.md) for custom instructions.
  • Run: chatgpt-md-translator [file-to-translate.md]
  • Official docs: https://github.com/smikitky/chatgpt-md-translator

Highlighted Details

  • Supports various OpenAI models (e.g., gpt-4o, gpt-3.5-turbo), with gpt-4o recommended.
  • Configurable FRAGMENT_TOKEN_SIZE for optimizing API calls and handling large documents.
  • TEMPERATURE parameter adjustable for controlling output randomness (default 0.1).
  • CODE_BLOCK_PRESERVATION_LINES option to prevent translation of code blocks.
  • Flexible output file naming and overwrite policies.

Maintenance & Community

  • Project appears to be maintained by a single author (smikitky).
  • No explicit community links (Discord/Slack) or roadmap mentioned in the README.

Licensing & Compatibility

  • The README does not explicitly state a license. This is a significant omission for open-source adoption.
  • Compatible with "Chat Completion" models from OpenAI.

Limitations & Caveats

The tool does not perform robust Markdown parsing, which may lead to issues with highly atypical Markdown structures. While it aims to preserve Markdown, users must review translations for accuracy and potential markup errors, as the API may sometimes ignore instructions or produce invalid Markdown.

Health Check
Last commit

4 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
8 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.