Hindura inzira ukoresheje configPath input nimba ukeneye ikibanza kidasanzwe.
Schema
# .github/resource-translator.ymlsourceLocale: en
# Provider config can be nested. Keep secrets in workflow inputs; use repo# config for non-secret defaults like region, model, formality, or category.provider: azure: categoryId: my-custom-translator-category apiVersion: "3.0" allowFallback: true
toLocales: - fr - de - esinclude: - "src/**/*.en.json" - "apps/**/*.en.resx"exclude: - "**/__tests__/**"glossary: Acme: Contoso Octocat: Octocat # keep brand names verbatim
# Translator request shape — most users can ignore these.textType: plain # plain | htmlprofanityAction: NoAction # NoAction | Marked | DeletedprofanityMarker: Asterisk # Asterisk | Tag (only when profanityAction == Marked)
# Resilience — Translator returns 429 under load. Defaults are usually# fine; tune only if your runs are large enough to hit them.maxRetries: 5retryBackoffMs: 30000 # cap on any single backoff sleep (ms)
# Placeholder protection. ON by default — wraps tokens like {{name}},# {0}, %s, ${var} into sentinels before translation and restores them# on the way back. Set false only when source intentionally contains# placeholder-shaped literals.protectPlaceholders: truecustomPlaceholderPatterns: - "<<.+?>>" # any extra token syntax you use
# Per-key opt-out. Keys matching any glob are dropped from the request# and pass through with the source value preserved.noTranslatePatterns: - "errors.code.*" - "brands.*"Field reference
providerEither a provider string or a nested provider block (provider.azure, provider.aws, or provider.google). Prefer nested blocks for provider-specific settings; keep secrets in workflow inputs rather than committed config.
sourceLocaleSubira ku murongo sourceLocale mu gihe utabikoze. Also forwarded to Translator as from=<locale> so short strings are not autodetected.
toLocalesCanke umurongo w'umurongo utandukanye na koma.
include / excludeGlob patterns tested against absolute and workspace-relative paths.
glossaryPost-translation term overrides. Word-boundary aware (handles C++, .NET).
categoryIdAzure Custom Translator category — your industry/domain knob (legal, medical, marketing tone, etc.). Sent as ?category=....
textTypeKudahana plain. Use html only if your resource values contain real HTML fragments.
profanityActionNi gute wahindura imvugo y'ikirundi mu majambo y'ubuhinduzi?
profanityMarkerNi vyiza gusa igihe profanityAction ari "Marked".
allowFallbackSet to false to fail the translation when your categoryId has no deployment for a target locale instead of falling back to the general model.
apiVersionTranslator REST API version. Kudahana 3.0.
awsFormalityAWS Translate formality setting for supported target languages.
awsBrevitySet to true to enable AWS Translate brevity mode for supported language pairs.
awsTerminologyNames / awsParallelDataNamesAWS Translate custom terminology and parallel data resource names. Either an array or comma-separated string.
googleModelGoogle Cloud Translation model, e.g. nmt or base.
googleApiEndpointOptional Google Cloud Translation API endpoint override.
googleAutoRetryOptional Google Cloud Translation automatic retry toggle. Leave unset to use the Google client default.
maxRetriesMaximum retry attempts on transient HTTP responses (408, 425, 429, 500, 502, 503, 504). Kudakora 5. Guhamagara HTTP kuri buri busabe ni 1 + maxRetries.
retryBackoffMsSuzumiya Haruka Ayase Kudahana 30000. Umutwe wa Retry-After wa Azure uraterwa iteka igihe uriho; otherwise jittered exponential backoff is used, capped at this value.
protectPlaceholdersKudahana true. Mu gihe bimaze gukorwa, ibimenyetso nka {{name}}, ${var}, {0}, {0:N2}, %s, %1$s na HTML birasubirizwa n'ibimenyetso vya sentinel imbere yo guhindurwa hanyuma bigasubizwa inyuma y'aho. Disable only when source intentionally contains placeholder-shaped literals.
customPlaceholderPatternsExtra regex patterns (without delimiters) added to the default placeholder set, e.g. <<.+?>> for custom token syntax. Invalid regexes are ignored.
noTranslatePatternsUburyo bwa Glob buhuye n'imfunguzo zo ku rwego rwa parser (JSON dotted path, RESX name, PO msgid, XLIFF unit id, INI / restext key). Imfunguzo zihuza zikurwa mu busabe hanyuma zigaca hamwe n'agaciro kazo k'inkomoko zibikwa.
changeDetectionDefaults to smart. Uses the committed state manifest to translate only changed or missing parser keys. Set to disabled or false to preserve the legacy always-translate behavior.
statePathPath to the deterministic smart change-detection state manifest. Defaults to .github/resource-translator-state.json.
Loading order
- The action reads explicit inputs from the workflow.
- It loads the YAML config from
configPath. - Ku murima wose uhuriweko, inyifato iratsinda; otherwise the YAML value is used.
- Ibiciro vy'ibiharuro vy'ibiharuro vy' Invalid enums (e.g.
profanityAction: Mask) cause the action to fail fast with a clear message.
Tone and industry, in plain terms
Azure AI Translator v3 API nta tone imwe ifise. Ibice bibiri bihuriye hamwe kugira ngo biguha igice kinini c'ubugenzuzi bumwe:
- Industry / domain: Use
categoryIdto point at an Azure Custom Translator category trained on your own corpus — legal, technical, medical, marketing, or anything else. Ico nico kimenyetso gikomeye cane c'amajwi, ijwi ry'ikirango hamwe n'amajambo. - Igisomwa co hejuru: Use the Glossary to lock brand names and product terms verbatim, and use
profanityActionto scrub profane terms when targeting localization for young audiences.