Ampidiro ny lalana amin'ny alàlan'ny fampidirana configPath raha mila toerana tsy misy default ianao.
Drafitra
# .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.*"Referansa an-tsaha
| Saha | Karazana | Fanamarihana |
|---|---|---|
sourceLocale | string | Miverina amin'ny fampidirana sourceLocale raha tsy apetraka. Nalefa tany amin'ny mpandika teny ihany koa from=<locale> ka tsy hita ho azy ny kofehy fohy. |
toLocales | string[] | Na array na kofehy misaraka amin'ny koma. |
include / exclude | string[] | Glob lamina tombana amin'ny tanteraka sy ny toeram-piasana-havana lalana. |
glossary | map<string,string> | Ny teny aorian'ny fandikan-teny. Teny sisin-tany (mitantana C++, .NET). |
categoryId | string | Sokajy Azure Custom Translator - ny bokotra indostria / sehatra (ara-dalàna, ara-pitsaboana, feo ara-barotra, sns.). Nalefa toy ny ?category=.... |
textType | "plain" | "html" | Default ho an'ny plain. Ampiasao html raha toa ka misy sombintsombiny HTML tena izy ny soatoavinao loharanon-karena. |
profanityAction | "NoAction" | "Marked" | "Deleted" | Ahoana ny fomba hitondrana ny teny ratsy amin'ny fandikan-teny. |
profanityMarker | "Asterisk" | "Tag" | Tsy misy dikany afa-tsy rehefa "Marked" profanityAction. |
allowFallback | boolean | Ataovy false tsy hahomby amin'ny fandikan-teny rehefa tsy manana fametrahana ho an'ny toerana kendrena ny categoryId anao fa tsy miverina amin'ny modely ankapobeny. |
apiVersion | string | Translator REST API version. Default ho an'ny 3.0. |
maxRetries | integer | Ny fanandramana fanandramana ambony indrindra amin'ny valiny HTTP mandalo (408, 425, 429, 500, 502, 503, 504). Default ho an'ny 5. Ny fitambaran'ny antso HTTP isaky ny fangatahana dia 1 + maxRetries. |
retryBackoffMs | integer | Cap (ms) amin'ny torimaso tokana. Default ho an'ny 30000. Ny lohan'ny Retry-After Azure dia omem-boninahitra amin'ny fotoana tena misy; raha tsy izany dia ampiasaina ny backoff exponential jittered, voafetra amin'io sanda io. |
protectPlaceholders | boolean | Default ho an'ny true. Rehefa mandeha ny famantarana toy ny {{name}}, ${var}, {0}, {0:N2}, %s, %1$s ary HTML dia soloina amin'ny famantarana sentinel alohan'ny fandikana ary averina amin'ny laoniny aorian'izay. Esory raha tsy misy loharano minia ahitana ara-bakiteny miendrika placeholder. |
customPlaceholderPatterns | string[] | Ny lamina regex fanampiny (tsy misy delimiters) dia nampidirina tao amin'ny seta placeholder default, ohatra <<.+?>> ho an'ny syntax custom token. Tsy noraharahiana ny regex tsy manan-kery. |
noTranslatePatterns | string[] | Ny lamina glob dia mifanaraka amin'ny fanalahidy parser (JSON dotted path, RESX name, PO msgid, XLIFF unit id, INI / restext key). Ny fanalahidy mifanandrify dia alatsaka avy amin'ny fangatahana ary mandalo miaraka amin'ny sandan'ny loharano voatahiry. |
Fandefasana baiko
- Ny hetsika dia mamaky ny fampidirana mazava avy amin'ny workflow.
- Izy io dia mampiditra ny config YAML avy amin'ny
configPath. - Ho an'ny saha iraisana rehetra, mandresy ny fampidirana; raha tsy izany dia ampiasaina ny sandan'ny YAML.
- Voamarina ireo soatoavina natambatra. Ny enum tsy manan-kery (ohatra
profanityAction: Mask) dia mahatonga ny hetsika tsy hahomby haingana amin'ny hafatra mazava.
Ny feo sy ny indostria, amin'ny teny tsotra
Ny Azure AI Translator v3 API dia tsy manana bokotra feo tokana. Ny toe-javatra roa dia mitambatra mba hanomezana anao ny ankamaroan'ny fanaraha-maso mitovy:
- Indostria / sehatra: ampiasao
categoryIdmba hanondro sokajy Azure Custom Translator voaofana amin'ny corpus anao manokana - ara-dalàna, ara-teknika, ara-pitsaboana, marketing, na zavatra hafa. Io no lever matanjaka indrindra ho an'ny feo, ny feon'ny marika ary ny voambolana. - Lahatsoratra ambony: Ampiasao ny Rakibolana mba hanidy ny anaran'ny marika sy ny teny momba ny vokatra am-bava, ary ampiasao
profanityActionmba hanadiovana ireo teny ratsy rehefa mikendry ny toerana ho an'ny mpihaino tanora.