Dlulisa umkhondo ngofakelo lwe-configPath uma udinga indawo engeyona emisiwe.
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.*"Inkomba yenkambu
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 emuva ekufakweni sourceLocale uma kungenzeki. Iphinde idluliselwe ku-Translator njengoba from=<locale> ngakho-ke izintambo ezimfushane azitholakali ngokuzenzakalelayo.
toLocalesNoma i-array noma intambo ehlukaniswe nge-comma.
include / excludeAmaphethini we-Glob ahlolwe ngokumelene nezindlela ezihlobene ngokuphelele nendawo yokusebenzela.
glossaryUkuhumusha kwegama lokuhumusha kudlulile. Word-boundary aware (izibambo C++, .NET).
categoryIdIsigaba se-Azure Custom Translator - imboni yakho / isizinda (ezomthetho, ezokwelapha, ithoni yokumaketha, njll.). Ithunyelwe njenge-?category=....
textTypeOkuzenzakalelayo ku-plain. Sebenzisa html kuphela uma amanani omnyombo wakho equkethe izingcezu zangempela ze-HTML.
profanityActionIndlela yokuphatha amagama ahlanzekile ekukhiqizeni okuhunyushiwe?
profanityMarkerOkunenjongo kuphela uma profanityAction "Marked".
allowFallbackSetha false ukwehluleka ukuhumusha uma categoryId yakho ingenakho ukuthunyelwa kwendawo okuhlosiwe esikhundleni sokubuyela emuva kumodeli ejwayelekile.
apiVersionUmhumushi we-REST API version. Okuzenzakalelayo ku-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.
maxRetriesImizamo ephezulu yokuzama kabusha izimpendulo ze-HTTP zesikhashana (408, 425, 429, 500, 502, 503, 504). Okuzenzakalelayo ku-5. Izingcingo ze-HTTP eziphelele ngesicelo ngasinye 1 + maxRetries.
retryBackoffMsI-Cap (ms) kunoma yikuphi ukulala okukodwa kwe-backoff. Okuzenzakalelayo ku-30000. Isihloko se-Retry-After se-Azure sihlonishwa ncamashi lapho sikhona; ngaphandle kwalokho kusetshenziswa i-backoff exponential, efakwe kuleli nani.
protectPlaceholdersOkuzenzakalelayo ku-true. Lapho ivuliwe, amathokheni afana ne-{{name}}, ${var}, {0}, {0:N2}, %s, %1$s ne-HTML athathelwa indawo ngamathokheni we-sentinel ngaphambi kokuhumusha futhi abuyiselwe ngemuva kwalokho. Khubaza kuphela uma umthombo uqukethe ngamabomu imibhalo emise okwendawo.
customPlaceholderPatternsAmaphethini we-regex angeziwe (ngaphandle kwama-delimiters) afakwe kusethi ye-placeholder ezenzakalelayo, isib. <<.+?>>-syntax yethokheni yangokwezifiso. Ama-regexes angavumelekile awanakwa.
noTranslatePatternsAmaphethini we-Glob ahambisana nokhiye bezinga le-parser (indlela yamachashazi e-JSON, i-RESX name, i-PO msgid, iyunithi ye-XLIFF id, ukhiye we-INI / restext). Okhiye abahambisanayo baphonswa esicelweni bese bedlula ngenani labo lomthombo lilondoloziwe.
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 i-oda
- Isenzo sifunda okokufaka okucacile komsebenzi wokusebenza.
- Ilayisha i-YAML config kusuka
configPath. - Kuyo yonke inkambu eyabiwe, okokufaka kunqoba; ngaphandle kwalokho inani le-YAML lisetshenziswa.
- Amanani ahlanganisiwe aqinisekisiwe. Ama-enums angaqinisekisiwe (isib.
profanityAction: Mask) enza isenzo sihluleke ngokushesha ngomyalezo ocacile.
Ithoni kanye nomkhakha ngamagama acacile
I-Azure AI Translator v3 API ayinayo inkinobho eyodwa yethoni. Izilungiselelo ezimbili zihlangana ukukunikeza iningi lokulawula okufanayo:
- Imboni / isizinda: sebenzisa
categoryIdukukhomba isigaba se-Azure Custom Translator esiqeqeshwe ku-corpus yakho - ezomthetho, ezobuchwepheshe, ezokwelapha, ukumaketha, noma yini enye. Lesi yisigwedlo esinamandla kakhulu sethoni, izwi lomkhiqizo, nesilulumagama. - Umbhalo ongaphezulu: Sebenzisa i-I-Glossary ukukhiya amagama omkhiqizo nemigomo yomkhiqizo ngezwi, futhi usebenzise i-
profanityActionukuhlanza amagama angcolile lapho ubhekise endaweni yezithameli ezincane.