Fa'afeso'ota'i le auala i le fa'amaumauga configPath pe afai e te mana'omia se nofoaga e le fa'aletonu.
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.*"Fa'asino i le fanua
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.
sourceLocaleToe fo'i i le sourceLocale fa'amaumauga pe a le fa'aaogaina. Fa'apea foi ona tu'uina atu i le Fa'aliliu Upu e pei o from=<locale> o lea e le mafai ai ona fa'ailoa mai ni manoa pu'upu'u.
toLocalesA le o se fa'ata'ita'iga po'o se koma-vavae'ese manoa.
include / excludeGlob mamanu iloiloina e faasaga i auala atoatoa ma workspace-relatif.
glossaryPost-translation term overrides. Upu-tuaoi iloa (taulimaina C++, .NET).
categoryIdAzure Custom Translator vaega — lau alamanuia / vaega knob (faaletulafono, faafomai, maketiina leo, ma isi). Auina atu e pei o ?category=....
textTypeFa'aletonu i le plain. Fa'aaoga html pe a fai o au punaoa o lo'o i ai ni vaega HTML moni.
profanityActionE fa'apefea ona fa'aliliuina upu masoa i le fa'aliliuga?
profanityMarkerE na o le taua pe a profanityAction "Marked".
allowFallbackSeti i le false e toilalo le faaliliuga pe afai e leai se categoryId o le faaaogaina mo se nofoaga autu nai lo le toe pa'u i tua i le faataitaiga lautele.
apiVersionTranslator REST API version. Fa'aletonu i le 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.
maxRetriesFa'ateleina taumafaiga toe taumafai i luga o tali HTTP le tumau (408, 425, 429, 500, 502, 503, 504). E le mafai ona 5. O le aofa'i o vala'au HTTP i le talosaga e 1 + maxRetries.
retryBackoffMsCap (ms) i luga o so'o se moe e tasi. Fa'aletonu i le 30000. O le ulutala Retry-After a Azure e fa'aaloalo tonu lava pe a i ai; a leai, o lo'o fa'aaogaina le fa'amalosia o le fa'alavelave fa'afuase'i, fa'atapula'aina i lenei fa'alavelave fa'afuase'i.
protectPlaceholdersFa'aletonu i le true. A i ai, o fa'ailoga e pei o le {{name}}, ${var}, {0}, {0:N2}, %s, %1$s ma HTML fa'alapotopotoga e suia i fa'ailoga sentinel a'o le'i fa'aliliuina ma toe fa'afo'i mulimuli ane. Fa'aleaogaina pe a fai o le punavai o lo'o i ai ni fa'ata'ita'iga fa'apitoa.
customPlaceholderPatternsFa'aopopo fa'ata'ita'iga regex (e aunoa ma le fa'atapula'aina) fa'aopopo i le seti placeholder faaletonu, mo se fa'ata'ita'iga <<.+?>> mo le syntax fa'ailoga masani. E le amana'iaina regexes le aoga.
noTranslatePatternsGlob mamanu fetaui ma parser-tulaga ki (JSON togitogi auala, RESX name, PO msgid, XLIFF iunite id, INI / restext ki). O ki e fetaui ma le a pa'u i lalo mai le talosaga ma pasi atu faatasi ai ma lo latou taua o le punavai ua faasaoina.
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.
Fa'atonuga o le utaina
- O le gaioiga e faitau ai fa'amatalaga manino mai le fa'agaioiga.
- E utaina le YAML config mai
configPath. - Mo fanua uma e fefa'asoaa'i, o le sao e manumalo; A leai, o le a fa'aaogaina le fa'aaogaina o le YAML.
- O tulaga faatauaina ua tuufaatasia ua faamaonia. O le fa'alavelave fa'afuase'i (mo se fa'ata'ita'iga,
profanityAction: Mask) e mafua ai le vave fa'aletonu o le gaioiga ma se fe'au manino.
Tone ma alamanuia, i faaupuga manino
O le Azure AI Translator v3 API e leai se tone knob e tasi. E lua fa'ata'ita'iga e tu'ufa'atasia e tu'uina atu ia te oe le tele o le fa'atonutonu tutusa:
- Alamanuia / vaega: fa'aaoga
categoryIde fa'asino ai i se vaega o le Azure Custom Translator a'oa'oina i luga o lau oe lava corpus — fa'aletulafono, fa'apitoa, fa'afoma'i, maketiina, po'o se isi lava mea. O le malosi lea mo le leo, leo o le ituaiga, ma le gagana. - Tusitusiga i luga: Fa'aaoga le Glossary e loka ai igoa ma oloa fa'aupuga verbatim, ma fa'aaoga
profanityActione fufulu ai upu masoa pe a fa'atatau i le localization mo le au maimoa laiti.