Skip to main content
The honyaku.dev GitHub Action translates your source file into multiple target languages and commits the results back to your repository.

Setup

1

Get an API key

Generate an API key from the settings page.
2

Add the API key to your repository

Go to your repository’s Settings > Secrets and variables > Actions and create a new secret named HONYAKU_API_KEY with your API key.
3

Create a workflow file

Create .github/workflows/translate.yml in your repository:
name: Translate

on:
  push:
    branches: [main]
    paths:
      - "en_US.json"

permissions:
  contents: write

jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: toshimichi/honyaku-action@v0
        with:
          source-file: "en_US.json"
          output-dir: "lang"
          targets: "ja:ja_JP.json, zh:zh_CN.json, ko:ko_KR.json"
          api-key: ${{ secrets.HONYAKU_API_KEY }}

Inputs

NameRequiredDefaultDescription
source-fileYesPath to the source translation file
output-dirYesOutput directory for translated files
targetsYesComma-separated list of target locales in <locale>:<filename> format
api-keyYesAPI key for authentication
translator-idNogpt_4_1_miniTranslator model ID
custom-promptNo""Custom prompt for the translator
base-urlNohttps://honyaku.dev/api/v1Base URL of the Honyaku API

Custom Prompts

You can use the custom-prompt input to give the translator additional context about your project:
- uses: toshimichi/honyaku-action@v0
  with:
    source-file: "en_US.json"
    output-dir: "lang"
    targets: "ja:ja_JP.json, zh:zh_CN.json, ko:ko_KR.json"
    api-key: ${{ secrets.HONYAKU_API_KEY }}
    custom-prompt: "Translate for a casual mobile game UI"

Lock File

The action creates a honyaku-lock.json file in your repository root to track the state of translations. Commit this file to your repository. It prevents redundant API calls by skipping translations when the source file hasn’t changed.

How It Works

  1. Computes the SHA-256 hash of the source file and compares it against honyaku-lock.json. If unchanged, the action exits early.
  2. Uploads the source file to the Honyaku API.
  3. Decompiles the file to extract translatable strings.
  4. Queues translation jobs for each target locale.
  5. Polls for job completion.
  6. Downloads the translated files and extracts them to the output directory.
  7. Updates honyaku-lock.json and commits/pushes the changes.