Auto-i18n  by linyuxuanlin

CLI tool for automated Markdown file translation using ChatGPT

created 1 year ago
376 stars

Top 76.7% on sourcepulse

GitHubView on GitHub
Project Summary

This tool automates the internationalization (i18n) of Markdown blog posts using ChatGPT, targeting content creators and developers who need to translate their work into multiple languages efficiently. It streamlines the process by handling batch translations, front matter compatibility, and fixed content replacement, significantly boosting productivity for multilingual projects.

How It Works

The core of Auto-i18n is its Python script, auto-translater.py, which processes Markdown files within a specified directory. It leverages the ChatGPT API for translation, supporting batch operations and intelligently handling front matter based on configurable rules (auto-translate, fixed replacement, or no processing). The tool also tracks processed files to avoid redundant translations and includes mechanisms for forced re-translation or skipping specific files.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Run translation: python auto-translater.py
  • Requires a ChatGPT API key (can be configured via env.py or GitHub Secrets).
  • For domestic China users, a local proxy for the official API might be necessary.
  • Demo: Power's Wiki

Highlighted Details

  • Batch translation of all Markdown files in a directory.
  • Front Matter compatibility with customizable translation rules.
  • Fixed content replacement for consistent terminology.
  • GitHub Actions integration for automated, push-triggered translation workflows.

Maintenance & Community

  • Open to contributions via a contribution guide.
  • Issues and support can be submitted via the GitHub issues page.
  • Mentions gratitude to chatanywhere/GPT_API_free and linweiyuan/go-chatgpt-api.

Licensing & Compatibility

  • MIT License.
  • Permissive for commercial use and integration with closed-source projects.

Limitations & Caveats

Translations may occasionally be inaccurate or incomplete, requiring manual review before publication. The tool relies on specific Markdown formatting (e.g., blank lines around special tags like [translate]) for certain functionalities.

Health Check
Last commit

1 year ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.