Ṣ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: 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.*"Itọkasi aaye
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.
sourceLocaleṢ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.
toLocalesTi o ba ti
include / excludeAwọn ilana Glob ti a ṣe ayẹwo lodi si awọn ọna ibatan pipe ati aaye iṣẹ.
glossaryPost-translation term overrides. Ọrọ-aala mọ (awọn ọwọ C++, .NET).
categoryIdẸ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. Lo html nikan ti awọn iye orisun rẹ ba ni awọn ajẹkù HTML gidi.
profanityActionBawo ni a ṣe le ṣe itumọ awọn itumọ ti o ni
profanityMarkerNikan ti o ni itumọ nigbati profanityAction "Marked".
allowFallbackṢ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.
apiVersionOnitumọ REST API version. Ìàêñèìàëüíûé ìàêñèìàëüíûé 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.
maxRetriesAwọ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.
retryBackoffMsfì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Ìàêñèìàëüíûé ìàêñèìàëüíûé 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.
customPlaceholderPatternsAfikun 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ẹ.
noTranslatePatternsAwọ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ọ.
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.
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ọ.