Sáraigh an cosán leis an ionchur configPath má theastaíonn suíomh neamhréamhshocraithe uait.
Scéimre
# .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.*"Tagairt réimse
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.
sourceLocaleTiteann sé ar ais go dtí an t-ionchur sourceLocale mura bhfuil sé socraithe. Chomh maith leis sin ar aghaidh chuig an Aistritheoir mar from=<locale> ionas nach ndéantar teaghráin ghearra a bhrath go huathoibríoch.
toLocalesEagar nó teaghrán scartha le camóga.
include / excludePatrúin glob a mheastar i gcoinne cosáin absalóideacha agus spás oibre.
glossarySáraíonn téarma iar-aistriúcháin. Feasach ar theorainn focal (láimhseálann C++, .NET).
categoryIdCatagóir Azure Custom Translator - do knob tionscail / fearainn (dlíthiúil, leighis, ton margaíochta, srl.). Seolta mar ?category=....
textTypeRéamhshocraithe go plain. Úsáid html ach amháin má tá fíor-bhlúirí HTML i do luachanna acmhainne.
profanityActionConas téarmaí profane a chóireáil san aschur aistrithe.
profanityMarkerAch amháin nuair a bhíonn profanityAction "Marked".
allowFallbackSocraigh go false go dteipfidh ar an aistriúchán nuair nach bhfuil aon imscaradh ag do categoryId le haghaidh sprioc-áitiúil seachas titim ar ais go dtí an tsamhail ghinearálta.
apiVersionLeagan API REST an Aistritheora. Réamhshocraithe go 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.
maxRetriesUasmhéid iarrachtaí athiarrachta ar fhreagairtí HTTP neamhbhuana (408, 425, 429, 500, 502, 503, 504). Réamhshocraithe 5. Is 1 + maxRetries glaonna HTTP iomlán in aghaidh an iarratais.
retryBackoffMsCaipín (ms) ar aon chodladh cúlú amháin. Réamhshocraithe go 30000. Tugtar onóir do cheanntásc Retry-After Azure go díreach nuair a bhíonn sé i láthair; seachas sin úsáidtear cúlú easpónantúil jittered, uasteorannaithe ag an luach seo.
protectPlaceholdersRéamhshocraithe go true. Nuair a bhíonn siad ar siúl, cuirtear comharthaí sentinel in ionad comharthaí cosúil le {{name}}, ${var}, {0}, {0:N2}, %s, %1$s agus HTML sula ndéantar iad a aistriú agus a athchóiriú ina dhiaidh sin. Díchumasaigh ach amháin nuair a bhíonn litreacha i gcruth ionaid ag an bhfoinse d'aon ghnó.
customPlaceholderPatternsPatrúin bhreise regex (gan teorannaithe) curtha leis an tacar ionaid réamhshocraithe, m.sh. <<.+?>> le haghaidh comhréir comhartha saincheaptha. Déantar neamhaird ar rialaithe neamhbhailí.
noTranslatePatternsPatrúin glob meaitseáilte i gcoinne eochracha leibhéal parsálaí (cosán poncaithe JSON, RESX name, PO msgid, aonad XLIFF id, eochair INI / restext). Titeann eochracha meaitseála ón iarratas agus téann siad tríd lena luach foinse caomhnaithe.
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.
Ord lochta
- Léann an gníomh ionchuir follasacha ón sreabhadh oibre.
- Luchtaíonn sé an chumraíocht YAML ó
configPath. - I gcás gach réimse roinnte, bhuaigh an t-ionchur; seachas sin úsáidtear an luach YAML.
- Déantar na luachanna cumaisc a bhailíochtú. Is cúis le enumaí neamhbhailí (m.sh.
profanityAction: Mask) go dteipeann ar an ngníomh go tapa le teachtaireacht shoiléir.
Ton agus tionscal, i dtéarmaí simplí
Níl knob ton amháin ag API Azure AI Translator v3. Comhcheanglaíonn dhá shuíomh chun an chuid is mó den rialú céanna a thabhairt duit:
- Tionscal / fearann: úsáid
categoryIdchun pointe a chur ar chatagóir Azure Custom Translator oilte ar do chorpas féin - dlíthiúil, teicniúil, leighis, margaíocht, nó aon rud eile. Is é seo an luamhán is láidre le haghaidh ton, guth branda, agus stór focal. - Téacs dromchla: bain úsáid as an gluais chun ainmneacha branda agus téarmaí táirge a ghlasáil go briathartha, agus bain úsáid as
profanityActionchun téarmaí profane a ghlanadh agus tú ag díriú ar logánú do lucht féachana níos óige.