Gqithisa indlela ngegalelo configPath ukuba ufuna indawo engagqibekanga.
Isikimu
# .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.*"Indawo ekubhekisela kuyo
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.
sourceLocaleBuyela kwigalelo sourceLocale ukuba ayimiselwanga. Kwakhona ithunyelwe kuMguquleli njengoko from=<locale> imitya emifutshane ayifumaneki ngokuzenzekelayo.
toLocalesNokuba luluhlu okanye umtya owahlulwe ngekoma.
include / excludeIipateni zeGlob ezivavanywa ngokuchasene neendlela ezipheleleyo kunye neendlela ezinxulumene nomsebenzi.
glossaryIxesha lokuguqulela emva kokuguqulela. Ulwazi lomda wegama (izibambo C++, .NET).
categoryIdUdidi lwe-Azure Custom Translator - ishishini lakho / i-domain knob (ezomthetho, ezonyango, ithoni yokuthengisa, njl.). Ithunyelwe njenge ?category=....
textTypeUkungaphumeleli plain. Sebenzisa html kuphela ukuba amaxabiso akho ezibonelelo aqulathe iziqwenga zokwenene ze HTML.
profanityActionIndlela yokujongana namagama ahlambulukileyo kwimveliso yokuguqulela?
profanityMarkerKuphela xa profanityAction "Marked".
allowFallbackCwangcisa kwi-false ukuze ungaphumeleli uguqulelo xa categoryId yakho ingenakho ukuthunyelwa kwendawo ekujoliswe kuyo endaweni yokubuyela kwimodeli ngokubanzi.
apiVersionUguqulelo lwe-API ye-REST UMGUQULI. Ukungaphumeleli 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.
maxRetriesUbuninzi beenzame zokuphinda zizame iimpendulo ze-HTTP zexeshana (408, 425, 429, 500, 502, 503, 504). Ukungaphumeleli 5. Iifowuni ezipheleleyo ze-HTTP ngesicelo ngasinye 1 + maxRetries.
retryBackoffMsCap (ms) nakweyiphi na i-backoff yokulala. Ukungaphumeleli 30000. I-Azure's Retry-After header ihlonitshwa kanye xa ikhona; Ngaphandle koko, i-jittered exponential backoff isetyenziswa, efakwe kweli xabiso.
protectPlaceholdersUkungaphumeleli true. Xa ivuliwe, iithokheni ezinje nge-{{name}}, ${var}, {0}, {0:N2}, %s, %1$s kunye ne-HTML zithathelwa indawo ngamathokheni e-sentinel ngaphambi kokuguqulelwa kwaye zibuyiselwe emva koko. Yenza ingasebenzi kuphela xa umthombo uqulethe ngabom iziqulathi ezimile okwendawo.
customPlaceholderPatternsIipateni ezongezelelweyo ze-regex (ngaphandle kwemida) zongezwa kwiseti yendawo engagqibekanga, umz. <<.+?>> ye-syntax yethokheni yesiko. Ii-regexes ezingaqinisekiswanga azihoywa.
noTranslatePatternsIipateni ze-Glob ezihambelana namaqhosha okwinqanaba lwe-parser (indlela yamachaphaza e-JSON, i-RESX name, i-PO msgid, iyunithi ye-XLIFF id, iqhosha le-INI/restext). Izitshixo ezihambelanayo ziyasuswa kwisicelo kwaye zidlule ngexabiso lazo lomthombo ligciniwe.
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.
Ukufaka umyalelo
- Isenzo sifunda amagalelo acacileyo avela kumsebenzi womsebenzi.
- Ilayisha i-YAML config ukusuka
configPath. - Kwintsimi nganye ekwabelwana ngayo, igalelo liyaphumelela; Ngaphandle koko, ixabiso le-YAML lisetyenziswa.
- Amaxabiso adityanisiweyo aqinisekisiwe. I-enums engasebenziyo (umz.
profanityAction: Mask) yenza isenzo singaphumeleli ngokukhawuleza ngomyalezo ocacileyo.
Ithoni kunye neShishini, ngokucacileyo
I-Azure AI Translator v3 API ayinayo iqhosha elinye leethoni. Izicwangciso ezimbini zidibeneyo ukukunika uninzi lolawulo olufanayo:
- Umzi-mveliso / indawo: Sebenzisa
categoryIdukukhomba kudidi lwe-Azure Custom Translator oluqeqeshwe kwi-corpus yakho - ezomthetho, ubuchwephesha, ezonyango, ukuthengisa, okanye nantoni na enye. Le yeyona lever inamandla kwithoni, ilizwi lophawu, kunye nesigama. - Umbhalo wokomhlaba: Sebenzisa i-I-Glossary ukutshixa amagama e-brand kunye nemigaqo yemveliso verbatim, kwaye usebenzise i-
profanityActionukucoca amagama angcolileyo xa ujolise ekuhlaleni kwabaphulaphuli abancinci.