Override chemen an ak opinyon configPath si ou bezwen yon kote ki pa default.
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.*"Referans jaden an
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.
sourceLocaleTonbe tounen nan opinyon an sourceLocale si se pa mete Tou voye pou tradiktè kòm from=<locale> se konsa strings kout yo pa otodetected.
toLocalesSwa yon etalaj oswa yon kòd separe virgèl.
include / excludeModèl Glob evalye kont chemen absoli ak espas travay relatif.
glossaryPost tradiksyon tèm Mo-fwontyè okouran (manch C++, .NET)
categoryIdKategori Custom Translator Azure — endistri ou / domèn bouton (legal, medikal, ton maketing, elatriye). Voye kòm ?category=...
textTypeDéfaut plain Sèvi ak html sèlman si valè resous ou yo gen fragman HTML reyèl.
profanityActionKi jan yo trete tèm pwofèn nan pwodiksyon tradui
profanityMarkerSèlman sans lè profanityAction "Marked".
allowFallbackMete nan false yo echwe tradiksyon an lè categoryId ou a pa gen okenn deplwaman pou yon lokal sib olye pou yo tonbe tounen nan modèl la jeneral.
apiVersionTradiktè vèsyon API REST Défaut 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.
maxRetriesTantativ retan maksimòm sou repons HTTP pasajè (408, 425, 429, 500, 502, 503, 504) Défaut 5 Total HTTP apèl pou chak demann 1 + maxRetries.
retryBackoffMsCap (ms) sou nenpòt ki sèl dòmi retounen. Défaut 30000 Azure Retry-After header onore egzakteman lè prezan; Sinon, jittered eksponansyèl rebak, bouche nan valè sa a.
protectPlaceholdersDéfaut true Lè sou, marqueur tankou {{name}}, ${var}, {0}, {0:N2}, %s, %1$s ak antite HTML yo ranplase ak siy santinèl anvan tradiksyon ak retabli apre sa. Enfim sèlman lè sous entansyonèlman gen literal plas-ki gen fòm.
customPlaceholderPatternsModèl regex siplemantè (san delimiteur) ajoute nan seri a placeholder default, egzanp <<.+?>> pou sentaks siy koutim. Regexes envalid yo inyore.
noTranslatePatternsModèl Glob matche ak parser-nivo kle (JSON pwen chimen, RESX name, PO msgid, XLIFF inite id, INI / retext kle). Matche kle yo tonbe nan demann lan ak pase nan ak valè sous yo konsève.
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 lòd
- Aksyon an li entrain eksplisit soti nan workflow la.
- Li chaje konfigirasyon an YAML soti nan
configPath. - Pou chak jaden pataje, opinyon an ranport; sinon se valè YAML la itilize.
- Valè yo fusionné yo valide. Enums envalid (egzanp
profanityAction: Mask) lakòz aksyon an echwe vit ak yon mesaj klè.
Ton ak endistri, an tèm plenn
API Azure AI Translator v3 pa gen yon bouton ton sèl. De anviwònman konbine ba ou pi fò nan kontwòl la menm:
- Endistri / domèn: Sèvi ak
categoryIdpou pwen nan yon kategori Custom Translator Azure ki resevwa fòmasyon sou pwòp corpus ou - legal, teknik, medikal, maketing, oswa nenpòt lòt bagay. Sa a se levye ki pi fò pou ton, vwa mak ak vokabilè. - Sifas tèks: Sèvi ak Glosè a pou fèmen non mak ak tèm pwodwi pou l verbatim, epi sèvi ak
profanityActionpou fwote tèm pwofon lè vize lokalizasyon pou odyans ki pi piti.