Dlulisa umkhondo ngofakelo lwe-configPath uma udinga indawo engeyona emisiwe.
Isikimu
# .github/resource-translator.ymlsourceLocale: entoLocales: - fr - de - esinclude: - "src/**/*.en.json" - "apps/**/*.en.resx"exclude: - "**/__tests__/**"glossary: Acme: Contoso Octocat: Octocat # keep brand names verbatim
# Domain / industry — uses an Azure Custom Translator category trained on# your tone and vocabulary. Leave unset for the general model.categoryId: my-custom-translator-category
# Translator request shape — most users can ignore these.textType: plain # plain | htmlprofanityAction: NoAction # NoAction | Marked | DeletedprofanityMarker: Asterisk # Asterisk | Tag (only when profanityAction == Marked)allowFallback: true # false fails when the categoryId has no deployment
apiVersion: "3.0"
# 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
| Insimu | Uhlobo | Amanothi |
|---|---|---|
sourceLocale | string | Buyela emuva ekufakweni sourceLocale uma kungenzeki. Iphinde idluliselwe ku-Translator njengoba from=<locale> ngakho-ke izintambo ezimfushane azitholakali ngokuzenzakalelayo. |
toLocales | string[] | Noma i-array noma intambo ehlukaniswe nge-comma. |
include / exclude | string[] | Amaphethini we-Glob ahlolwe ngokumelene nezindlela ezihlobene ngokuphelele nendawo yokusebenzela. |
glossary | map<string,string> | Ukuhumusha kwegama lokuhumusha kudlulile. Word-boundary aware (izibambo C++, .NET). |
categoryId | string | Isigaba se-Azure Custom Translator - imboni yakho / isizinda (ezomthetho, ezokwelapha, ithoni yokumaketha, njll.). Ithunyelwe njenge-?category=.... |
textType | "plain" | "html" | Okuzenzakalelayo ku-plain. Sebenzisa html kuphela uma amanani omnyombo wakho equkethe izingcezu zangempela ze-HTML. |
profanityAction | "NoAction" | "Marked" | "Deleted" | Indlela yokuphatha amagama ahlanzekile ekukhiqizeni okuhunyushiwe? |
profanityMarker | "Asterisk" | "Tag" | Okunenjongo kuphela uma profanityAction "Marked". |
allowFallback | boolean | Setha false ukwehluleka ukuhumusha uma categoryId yakho ingenakho ukuthunyelwa kwendawo okuhlosiwe esikhundleni sokubuyela emuva kumodeli ejwayelekile. |
apiVersion | string | Umhumushi we-REST API version. Okuzenzakalelayo ku-3.0. |
maxRetries | integer | Imizamo 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. |
retryBackoffMs | integer | I-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. |
protectPlaceholders | boolean | Okuzenzakalelayo 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. |
customPlaceholderPatterns | string[] | Amaphethini we-regex angeziwe (ngaphandle kwama-delimiters) afakwe kusethi ye-placeholder ezenzakalelayo, isib. <<.+?>>-syntax yethokheni yangokwezifiso. Ama-regexes angavumelekile awanakwa. |
noTranslatePatterns | string[] | Amaphethini 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. |
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.