A mono i te e'a e te configPath mai te mea e hinaaro outou i te hoê vahi e ere i te mea matauhia.
Hoho'a
# .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.*"Faahororaa no te tuhaa fenua
| Tuhaa fenua | Huru | Te mau nota |
|---|---|---|
sourceLocale | string | E ho'i mai i ni'a i te sourceLocale mai te mea e, aita i haamauhia. E hapono-atoa-hia i te Translator ei from=<locale> ia ore te mau taura poto e ite-noa-hia. |
toLocales | string[] | Te hoê anairaa anei e aore râ, te hoê taura tei faataa-ê-hia e te vira. |
include / exclude | string[] | Te mau hoho'a o te glob tei hi'opo'ahia ia au i te mau e'a papû e te vahi ohiparaa. |
glossary | map<string,string> | Te mau ta'o i muri a'e i te iritiraa. Haapa'o i te oti'a o te ta'o (e haapa'o i te C++, .NET). |
categoryId | string | Azure Custom Translator category — ta outou tuhaa ohipa (ture, rapaauraa, tapihooraa, e te tahi atu â). Haponohia mai te ?category=.... |
textType | "plain" | "html" | E tano i te plain. A faaohipa i te html mai te mea te vai ra te mau hu'ahu'a HTML mau i roto i ta outou mau faufaa. |
profanityAction | "NoAction" | "Marked" | "Deleted" | Nahea ia faaohipa i te mau parau faufau i roto i te iritiraa. |
profanityMarker | "Asterisk" | "Tag" | E mea faufaa noa ia profanityAction i te "Marked". |
allowFallback | boolean | A faanaho i ni'a i te false ia ore e manuïa i te iritiraa mai te mea e, aita ta outou categoryId e faaohipahia no te hoê vahi opuaraa, eiaha râ e ho'i faahou i ni'a i te hoho'a rahi. |
apiVersion | string | Translator REST API version. E tano i te 3.0. |
maxRetries | integer | Rahiraa tamataraa no te tamata faahou i ni'a i te mau pahonoraa HTTP poto (408, 425, 429, 500, 502, 503, 504). E tano i te 5. Te taatoaraa o te mau niuniu HTTP i te aniraa tata'itahi, e 1 + maxRetries ïa. |
retryBackoffMs | integer | A tapo'i (ms) i ni'a i te hoê noa taotoraa. E tano i te 30000. E faahanahanahia te upoo parau Retry-After Azure i te taime ti'a ; aita ana'e, e faaohipahia te backoff exponential jittered, taoti'ahia i teie faufaa. |
protectPlaceholders | boolean | E tano i te true. Mai te mea e, e monohia te mau token mai te {{name}}, ${var}, {0}, {0:N2}, %s, %1$s e HTML e te mau token sentinel hou te iritiraa e e faaho'ihia mai i muri iho. A tupohe noa mai te mea e, te vai ra te mau parau mau i roto i te tumu parau. |
customPlaceholderPatterns | string[] | Te tahi atu mau hoho'a regex (aita e taoti'araa) tei tuuhia i ni'a i te faanahoraa placeholder, ei hi'oraa, <<.+?>> no te syntax o te token. Aita te mau regex tano ore e tau'a-ore-hia. |
noTranslatePatterns | string[] | Te mau hoho'a glob e tu'ati i ni'a i te mau taviri parser (JSON dotted path, RESX name, PO msgid, XLIFF unit id, INI/restext key). E faaru'ehia te mau taviri tu'ati mai roto mai i te aniraa e e faahereherehia te faufaa tumu. |
Faanahoraa no te faautaraa
- E tai'o te ohipa i te mau mana'o papû no roto mai i te tereraa ohipa.
- E faauta te reira i te faanahoraa YAML mai te
configPath. - No te mau tuhaa tata'itahi, e upooti'a te mana'o ; aita ana'e, e faaohipahia te faufaa YAML.
- E haamanahia te mau faufaa amuihia. E faatupu te mau enum hape (ei hi'oraa,
profanityAction: Mask) i te manuïa vitiviti o te ohipa na roto i te hoê poro'i maramarama.
Te ta'iraa e te ohipa, i roto i te mau parau ohie
Aita e pitopito ta'iraa i roto i te Azure AI Translator v3 API. E piti faanahoraa e amuihia no te horo'a ia outou i te hoê â hi'opo'araa :
- Ohipa / tuhaa : a faaohipa i te
categoryIdno te faatoro i te hoê tuhaa Azure Custom Translator tei haapiipiihia i ni'a i ta outou iho faanahoraa — i te pae no te ture, i te pae aravihi, i te pae rapaauraa, i te tapihooraa, e aore râ, i te tahi atu mea. Teie te rave'a puai roa a'e no te ta'iraa, te reo e te ta'o. - Papa'iraa i ni'a i te papa'iraa : A faaohipa i te Glossary no te ponao i te mau i'oa o te mau tao'a e te mau parau no te mau tauihaa, e a faaohipa i te
profanityActionno te tatara i te mau parau faufau no te faanaho i te vahi no te feia apî.