Giter Site home page Giter Site logo

nvenitius / gpt-translate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 3ru/gpt-translate

0.0 0.0 0.0 790 KB

💬Translate Markdown into Any Languages with AI

Home Page: https://g-t.vercel.app

License: MIT License

JavaScript 4.19% TypeScript 47.26% CSS 2.24% MDX 46.31%

gpt-translate's Introduction

🌎 Markdown Translation BOT

Maintainability GPT Translate

This GitHub action translates your markdown files into multiple languages using the GPT-3.5 model.

⚠️Warning

The OpenAI API is currently not available for free. You need an API Key issued with a paid account to use this workflow.
image


🧐 Current Status

  • The action supports translating markdown files only.

  • The command can be executed exclusively by individuals with write permissions to the repository.

These limitations prevent API abuse by non-trusted parties.

🔧 Setup

Repository Settings

1. Settings > Actions > General

  • Enable Read and write permissions
  • Enable Allow GitHub Actions to create and approve pull requests permissions

2. Settings > Secrets and variables > Actions

GitHub Actions Workflow Settings

Required

  • Provide the OPENAI_API_KEY as apiKey.
  • Set on to trigger when a comment is created (types: [ created ]).
  • Checkout in advance(actions/checkout@v3).

Recommended (To minimize unnecessary run time)

  • Configure if to run only when /gpt-translate or /gt is present in the comment.

👇 Here is a minimal workflow example:

# .github/workflows/gpt-translate.yml
name: GPT Translate

on:
  issue_comment:
    types: [ created ]

jobs:
  gpt_translate:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Run GPT Translate
        if: |
          contains(github.event.comment.body, '/gpt-translate') || 
          contains(github.event.comment.body, '/gt')
        uses: 3ru/[email protected]
        with:
          apikey: ${{ secrets.OPENAI_API_KEY }}

💡 Usage

/gpt-translate [input filepath] [output filepath] [target language] 

You can use /gt as a shorthand for /gpt-translate.

1.Create a comment with /gpt-translate or /gt in an issue or pull request.

2.【On issue】Translated files will be created as a pull request.

2.【On pull request】Translated files will be added to the pull request with new commit.

In other words, if you keep commenting on an issue, new PRs will continuously be created. If you keep commenting on a PR, new commits will continuously be added to that PR.

📝 Example

/gpt-translate README.md zh-TW/README.md traditional-chinese

Translate README.md into traditional Chinese and place it under the zh-TW directory.

v1.1 Multiple file support

You can now translate multiple files at once by specifying a wildcard in the input file path.

Here is a sample

/gpt-translate *.md *.ja.md Japanese

If A.md and B.md are in the root directory, the output will be A.ja.md and B.ja.md. The file names are inherited from the input files. I am considering outputting the file with an arbitrary file name, but if you have a smart idea, please suggest it through the issue!

🌐 Supported Languages

Any language interpreted by GPT-3.5

🏘️ Community

  • Discussions
    • If you have any questions, please feel free to ask in the GitHub Discussions :)
  • Issues
    • Please submit bugs and new feature suggestions to GitHub Issues

📃 License

MIT License

gpt-translate's People

Contributors

3ru avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.