This GitHub Action detects changes in specified file types (Markdown, JSON, TXT, etc.), translates the modified content using various AI models (OpenAI GPT-4, Google Gemini, Anthropic Claude, Microsoft Azure Translator), and commits the translations back to your repository.
Add the following workflow to your .github/workflows/translate.yml
file (or add the step in any of your pipelines!):
name: Translate Files on: push: branches: - main jobs: translate: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 - name: Run Translation Action uses: imaun/gpt-translate-action@v1.4 with: api_key: ${{ secrets.API_KEY }} ai_service: "openai" # Options: openai, gemini, claude, azure ai_model: "gpt-4" # Specify model (e.g., gemini-pro, claude-v1) target_lang: "French" target_lang_code: "fr" file_extensions: "md,json,txt" output_format: "translated_*.{ext}"
api_key
(Required): Your AI provider API key (stored as a GitHub Secret).ai_service
: AI provider to use. Currently supported values: (openai, gemini, claude, azure)ai_model
: AI model to use (e.g., gpt-4, gemini-pro, claude-v1).target_lang
: The language to translate into (default: Persian).target_lang_code
: The language code to be used in output format (default: fa).file_exts
: Comma-separated list of file types to process (default: md).output_format
: Format for translated files. Use {lang} for language and {ext} for extension.*-{lang}.{ext}
: about-fa.mdtranslated_*.{ext}
: translated_about.jsonAPI_KEY
and paste your AI service API key.There are no models linked
There are no models linked
There are no datasets linked
There are no datasets linked