ievangelist/Machine Translator

Automatically open machine-translated pull requests for resource files using Azure, AWS, or Google translation providers. Supports .resx, .restext, .ini, .xliff, .po, and .json.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jul 10, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: ievangelist/resource-translator@3644162f34da29f7c2b742ccaa884f911c451502 # v3.0.2

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
sourceLocaleSource locale (e.g. 'en') used to find translation files (e.g. **/*.en.resx).yes
providerTranslation provider to use: 'azure' (default), 'aws', or 'google'. Also accepts a YAML/JSON provider block such as `azure: { subscriptionKey, endpoint }`, `aws: { region, formality }`, or `google: { apiKey, model }`. Flat inputs below still work and override values inside the block.no
subscriptionKeyAzure AI Translator resource subscription key. Required when provider is 'azure'. Pass via secrets.no
endpointAzure AI Translator resource endpoint (e.g. 'https://api.cognitive.microsofttranslator.com/'). Required when provider is 'azure'.no
regionAzure AI Translator resource region (optional for global resources).no
awsAccessKeyIdAWS access key id. Optional — when omitted (along with awsSecretAccessKey) the AWS SDK default credential chain is used (recommended: OIDC via aws-actions/configure-aws-credentials). Pass via secrets.no
awsSecretAccessKeyAWS secret access key. Must be supplied together with awsAccessKeyId. Pass via secrets.no
awsSessionTokenOptional AWS session token for temporary credentials. Pass via secrets.no
awsRegionAWS region for the Translate service (e.g. 'us-east-1'). Required when provider is 'aws' unless AWS_REGION is set in the environment (e.g. by aws-actions/configure-aws-credentials).no
awsFormalityAWS Translate formality setting: 'FORMAL' or 'INFORMAL'. Optional; ignored by Azure and Google.no
awsBrevityWhen 'true', enables AWS Translate brevity mode for supported language pairs. Optional; ignored by Azure and Google.no
awsTerminologyNamesOptional AWS Translate custom terminology resource names. Accepts a JSON array or comma-separated values.no
awsParallelDataNamesOptional AWS Translate parallel data resource names. Accepts a JSON array or comma-separated values.no
googleApiKeyGoogle Cloud API key. Provide this OR googleCredentials when provider is 'google'. Pass via secrets.no
googleCredentialsGoogle Cloud service-account key as a JSON string. Provide this OR googleApiKey when provider is 'google'. Pass via secrets.no
googleProjectIdOptional Google Cloud project id. Usually inferred from the service-account credentials.no
googleModelOptional Google Cloud Translation model, e.g. 'nmt' or 'base'.no
googleApiEndpointOptional Google Cloud Translation API endpoint override.no
googleAutoRetryOptional Google Cloud Translation auto-retry toggle. When unset, the Google client default applies; use maxRetries to control retry count.no
toLocalesOptional locales to translate to. Accepts a JSON array (`["es","de","fr"]`) or comma-separated values (`es,de,fr`). When omitted, every supported locale is targeted.no
includeOptional newline-separated glob patterns to include. When set, only matching files are translated.no
excludeOptional newline-separated glob patterns to exclude. Applied after `include`.no
configPathOptional path to a YAML config file (defaults to `.github/resource-translator.yml`). Repository config keys are merged underneath the action inputs.no.github/resource-translator.yml
categoryIdOptional Azure AI Translator Custom Translator category ID. Azure-only; ignored by the aws and google providers.no
apiVersionTranslator API version. Defaults to '3.0'. Azure-only; ignored by the aws and google providers.no
textTypeText type — 'plain' (default) or 'html'. Use 'html' only when resource values contain real HTML fragments. Mapped for azure (textType) and google (format); ignored by aws (no plain/html toggle).no
profanityActionHow to handle profanity in translations: 'NoAction' (default), 'Marked', or 'Deleted'. Azure honors all values; aws maps 'Marked'/'Deleted' to masking; google has no equivalent and ignores it.no
profanityMarkerHow to mark profanity when 'profanityAction' is 'Marked': 'Asterisk' (default) or 'Tag'. Azure-only.no
allowFallbackWhen 'false', Translator returns an error instead of falling back to the general system if the chosen 'categoryId' has no deployment for a target locale. Defaults to the Translator default (true) when unset. Azure-only.no
noTranslatePatternsOptional newline-separated glob patterns matched against parser key paths (resx 'name', po 'msgid', xliff unit 'id', '[--]'-joined paths for json, raw key for ini/restext). Matching keys are kept verbatim and never sent to Translator.no
changeDetectionSmart change detection mode. Defaults to 'smart', which uses a deterministic state manifest to translate only changed/missing keys. Set to 'disabled' (or 'false') to translate every eligible key on every run.no
statePathPath to the deterministic smart change-detection state manifest, relative to the workspace root unless absolute.no
protectPlaceholdersWhen 'true' (default), wrap '{{name}}', '{0}', '%s', '${var}', etc. in stable sentinels so Translator does not rearrange or translate them. Set to 'false' only if your source contains literal placeholder-like sequences.no
customPlaceholderPatternsOptional newline-separated regex patterns appended to the placeholder protector. Each pattern is compiled with the global flag if it does not start with a literal '/'. Invalid patterns are skipped.no
maxRetriesNumber of additional attempts on transient Translator failures (HTTP 408, 425, 429, 500, 502, 503, 504). Total HTTP calls per request = 1 + maxRetries. Defaults to 5.no
retryBackoffMsCap (ms) on any single backoff sleep between retries. Translator's 'Retry-After' header is honored exactly when present; otherwise a jittered exponential sleep is used, capped at this value. Defaults to 30000.no
dryRunWhen 'true', perform translations and emit summary outputs but do not write files.nofalse
snapshotOnlyWhen 'true', bootstrap/update the smart change-detection state manifest from existing source and target files without calling a translation provider or writing target resource files. Useful for seeding .github/resource-translator-state.json before enabling normal incremental runs.nofalse
failOnErrorWhen 'true' (default), unexpected errors fail the action. When 'false', errors are logged as warnings.notrue
namedescription
summary-titleA short summary suitable for a PR title (e.g. "Machine-translated 320 files, a total of 5,418 translations").
summary-detailsA markdown summary, suitable for a PR body or job summary.
has-new-translationsBoolean as string. 'true' when one or more new translations were generated.