Ṣe àgbékalẹ̀ ọ̀nà náà pẹ̀lú àtúnṣe configPath tí o bá nílò ààyè tí kì í ṣe àyípadà.
Sikematiki
# .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.*"Itọkasi aaye
| Aaye | Iru | Awọn akọsilẹ |
|---|---|---|
sourceLocale | string | Ṣubu pada si sourceLocale titẹ sii ti o ko ba ṣeto. Pẹlupẹlu, o ti firanṣẹ si Onitumọ bi from=<locale> nitorinaa awọn okun kukuru ko ṣe awari laifọwọyi. |
toLocales | string[] | Ti o ba ti |
include / exclude | string[] | Awọn ilana Glob ti a ṣe ayẹwo lodi si awọn ọna ibatan pipe ati aaye iṣẹ. |
glossary | map<string,string> | Post-translation term overrides. Ọrọ-aala mọ (awọn ọwọ C++, .NET). |
categoryId | string | Ẹka Custom Translator Azure — ile-iṣẹ rẹ / bọtini ašẹ rẹ (ofin, iṣoogun, ohun orin titaja, ati bẹbẹ lọ). Ti a firanṣẹ bi ?category=.... |
textType | "plain" | "html" | Ìàêñèìàëüíûé ìàêñèìàëüíûé plain. Lo html nikan ti awọn iye orisun rẹ ba ni awọn ajẹkù HTML gidi. |
profanityAction | "NoAction" | "Marked" | "Deleted" | Bawo ni a ṣe le ṣe itumọ awọn itumọ ti o ni |
profanityMarker | "Asterisk" | "Tag" | Nikan ti o ni itumọ nigbati profanityAction "Marked". |
allowFallback | boolean | Ṣeto lati false lati kuna itumọ nigbati categoryId rẹ ko ni imuṣiṣẹ fun agbegbe ibi-afẹde dipo ki o ṣubu pada si awoṣe gbogbogbo. |
apiVersion | string | Onitumọ REST API version. Ìàêñèìàëüíûé ìàêñèìàëüíûé 3.0. |
maxRetries | integer | Awọn igbiyanju atunyẹwo ti o pọju lori awọn idahun HTTP ti o kọja (408, 425, 429, 500, 502, 503, 504). Ìàêñèìàëüíûé ìàêñèìàëüíûé 5. Lapapọ awọn ipe HTTP fun ibeere kọọkan jẹ 1 + maxRetries. |
retryBackoffMs | integer | fìlà (ms) lórí gbogbo oorun ẹ̀yìn kan. Ìàêñèìàëüíûé ìàêñèìàëüíûé 30000. Akọle Retry-After Azure ni a bọwọ fun gangan nigbati o wa; bibẹkọ ti jittered exponential backoff ti wa ni lo, capped ni yi iye. |
protectPlaceholders | boolean | Ìàêñèìàëüíûé ìàêñèìàëüíûé true. Nigbati o ba wa lori, awọn ami bii {{name}}, ${var}, {0}, {0:N2}, %s, %1$s ati awọn nkan HTML ni a rọpo pẹlu awọn ami sentinel ṣaaju itumọ ati mu pada lẹhinna. Pa nikan nigbati orisun ba ni awọn itumọ ọrọ ti o ni ilọsiwaju. |
customPlaceholderPatterns | string[] | Afikun regex elo (lai delimiters) fi kun si awọn aiyipada placeholder ṣeto, e.g. <<.+?>> fun aṣa àmi sintasi. Awọn regexes ti ko wulo ni a foju silẹ. |
noTranslatePatterns | string[] | Awọn ilana Glob ti o baamu lodi si awọn bọtini ipele parser (ọna aami JSON, RESX name, PO msgid, XLIFF kuro id, INI / bọtini restext). Awọn bọtini ti o baamu ni a fi silẹ lati ibeere naa ki o kọja pẹlu iye orisun wọn ti a fipamọ. |
Loading ibere
- Iṣe naa ka awọn igbewọle ti o han gbangba lati iṣẹ ṣiṣe.
- O ṣe ikojọpọ YAML config lati
configPath. - Fun aaye kọọkan ti a pin, titẹ sii bori; bibẹkọ ti awọn YAML iye ti wa ni lo.
- Awọn iye ti a dapọ ni a fọwọsi. Awọn enums ti ko wulo (fun apẹẹrẹ
profanityAction: Mask) fa iṣe naa kuna ni kiakia pẹlu ifiranṣẹ ti o han gbangba.
Ohun orin ati ile-iṣẹ, ni awọn ofin ti o han gbangba
Azure AI Translator v3 API ko ni bọtini ohun orin kan. Awọn eto meji papọ lati fun ọ ni ọpọlọpọ awọn iṣakoso kanna:
- Ile-iṣẹ / ašẹ: Lo
categoryIdlati tọka si ẹka Azure Custom Translator ti o ni ikẹkọ lori corpus tirẹ — ofin, imọ-ẹrọ, iṣoogun, titaja, tabi ohunkohun miiran. Eyi ni lefa ti o lagbara julọ fun ohun orin, ohun iyasọtọ, ati fokabulari - Ọrọ oju-aye: Lo Glossary lati tii awọn orukọ iyasọtọ ati awọn ofin ọja ni otitọ, ati lo
profanityActionlati fọ awọn ọrọ alailẹgbẹ nigbati o ba fojusi agbegbe fun awọn olugbo ọdọ.