gpt-translate  by 3ru

AI-powered file translation for GitHub workflows

Created 3 years ago
251 stars

Top 99.8% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

3ru/gpt-translate is a GitHub Action designed to automate the translation of markdown, MDX, and JSON files within a repository using AI models. It targets developers and content creators needing to localize documentation or data, streamlining the translation process by automatically generating pull requests or commits with translated content.

How It Works

This project functions as a GitHub Action triggered by specific comments (/gpt-translate or /gt) in issues or pull requests. Upon detection, it invokes AI models from various providers (including OpenAI) to translate specified files. The action then automatically creates a new pull request containing the translated files if triggered on an issue, or adds translated files as new commits if triggered on an existing pull request.

Quick Start & Requirements

Setup requires enabling "Read and write permissions" and "Allow GitHub Actions to create and approve pull requests" in repository settings. An API key for the chosen AI model provider (e.g., OPENAI_API_KEY) must be configured as a GitHub secret. A minimal workflow file (.github/workflows/gpt-translate.yml) is provided, utilizing actions/checkout@v4. Usage involves commenting /gpt-translate [input filepath] [output filepath] [target language] or /gt in an issue or PR. Wildcards can be used for batch translation.

Highlighted Details

  • Supports AI models from multiple providers, offering flexibility beyond OpenAI.
  • Handles translation for .md, .mdx, and .json file formats.
  • Automates the creation of translated content via pull requests or commits directly within GitHub.
  • Enables batch translation of multiple files using wildcard patterns.
  • Supports any language interpretable by GPT-4 or GPT-3.5 models.

Maintenance & Community

Community questions are directed to GitHub Discussions, while bug reports and feature requests should be submitted via GitHub Issues.

Licensing & Compatibility

The project is released under the MIT License, which generally permits broad use, including commercial applications and linking within closed-source projects.

Limitations & Caveats

Currently, the action exclusively supports .md, .mdx, and .json file types. Its execution is restricted to users with write permissions on the repository to mitigate API abuse by untrusted parties.

Health Check
Last Commit

7 months ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.