Reference
GitHub Action
Find missing translation keys and translate them via LLM. Provider-agnostic: supports OpenAI, Anthropic, and Google.
The action installs @the-i18n-kit/cli and the SDK matching the chosen provider, runs the translate command, and opens a pull request with what it wrote. The command owns the pass/fail decision and reports it as an exit code; the action reads counts for its outputs and the log only.
Inputs and outputs below are generated from action.yml, so a workflow that sets an input listed here is a workflow GitHub accepts.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
provider | yes | — | LLM provider: openai, anthropic, or google |
model | yes | — | Model name (e.g. gpt-4o, claude-3-5-sonnet-20241022, gemini-2.0-flash) |
api_key | yes | — | API key for the chosen provider |
layer | yes | — | Layer name to translate (e.g. common, dashboard) |
locales | no | — | Comma-separated target locales (default: all except source) |
source_locale | no | — | Reference/source locale (default: project default from .i18n-mcp.json) |
keys | no | — | Comma-separated keys to translate (default: all missing) |
batch_size | no | 50 | Keys per LLM call (default: 50) |
dry_run | no | false | Preview translations without writing files |
fail_on_failed | no | false | Fail the step (exit 2) when any key failed to translate. Off by default: a partly failed run still writes what succeeded, and the failed keys stay missing for the next run to retry. |
working_directory | no | ${{ github.workspace }} | Project root directory (default: github.workspace) |
create_pr | no | true | Create a PR with the translated files |
pr_branch | no | — | Branch name for the PR (default: i18n/translate-missing-<timestamp>) |
commit_message | no | — | Commit message (default: "chore(i18n): translate missing keys via <provider>") |
pr_title | no | — | PR title (default: "chore(i18n): translate missing keys") |
github_token | no | ${{ github.token }} | GitHub token for creating PRs. Defaults to GITHUB_TOKEN. |
base_branch | no | — | Base branch for the PR (default: the branch that triggered the workflow) |
cli_version | no | latest | the-i18n-cli version to install (npm dist-tag or version). Use "skip" if the CLI is already installed (e.g. a local build). |
Outputs
| Output | Description |
|---|---|
gate_tripped | Names of any CI gates that tripped. The job fails after the translations are committed. |
translated_count | Number of keys translated |
failed_count | Number of keys that failed to translate |
pr_url | URL of the created PR (only when create_pr is true) |
A tripped gate does not skip the pull request step. The step that runs
translate records the gate in gate_tripped and lets the commit happen, and a later step fails the job — so a run that found something still keeps the translations it produced.