Anular ruta ko ar entrada configPath nu'bu̲ t'ot'e 'nar ja yá 'mui hingi predeterminada.
Esquema
# .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.*"Referencia hwähi
| Hwähi | Ar klase | Notas |
|---|---|---|
sourceLocale | string | Ho̲e ar 'ñäñho ar sourceLocale entrada nu'bu̲ hingi da t'ot'e. 'Nehe reenviado ma Translator komongu from=<locale> ngut'ä hingi bí detectan automáticamente ya cadenas cortas. |
toLocales | string[] | Ya da 'nar matriz wa 'nar cadena separada ya comas. |
include / exclude | string[] | Patrones globo evaluados dige ya rutas absolutas ne ir nge ar espacio ar 'be̲fi. |
glossary | map<string,string> | Anulación ar ngäts'i post-traducción. Mfädi jar límite po̲ts'e (maneja C++, .NET). |
categoryId | string | Categoría Custom Translator Azure — ár industria yá dominio perilla (legal, médico, wa ar ñhöñhö marketing, etc.). Pe̲hni komongu ar ?category=.... |
textType | "plain" | "html" | Ar defecto ar plain. Utilice html ho̲ntho nu'bu̲ yá valores recursos contienen fragmentos HTML reales. |
profanityAction | "NoAction" | "Marked" | "Deleted" | Tema japi ngäts'i profanos jar salida traeda. |
profanityMarker | "Asterisk" | "Tag" | Ho̲ntho ne ar profanityAction nu'bu̲ "Marked" |
allowFallback | boolean | Da t'ot'e jar false pa fallar ar traducción nu'bu̲ ár categoryId hingi pe̲ts'i ningún despliegue pa 'nar ja 'mu̲i en lugar de caer ar nuevo jar modelo Nxoge. |
apiVersion | string | Traductor versión API REST. Ar defecto ar 3.0. |
maxRetries | integer | Intentos reintentos máximos jar nthädi HTTP transitorias (408, 425, 429, 500, 502, 503, 504). Ar defecto ar 5. Nxoge llamadas HTTP ya petición ar 1 + maxRetries. |
retryBackoffMs | integer | Cap (ms) jar 'na Honto ar ähä retroceso. Ar defecto ar 30000. Ar cabecera Retry-After Azure ar honra exactamente nu'bu̲ 'bui; Ar nä'ä contrario ar gi japu̲'be̲fi retroceso exponencial tremolo, limitado jar nuna hmädi. |
protectPlaceholders | boolean | Ar defecto ar true. Nu'bu̲ activado, fichas komongu ar {{name}}, ${var}, {0}, {0:N2}, %s, %1$s ne HTML entidades ar reemplazan ko fichas centinela nu'bu ar traducción ne ar restauran 'me̲fa. Deshabilitar ho̲ntho nu'bu̲ fuente contiene intencionalmente literales dets'e marcador ar posición. |
customPlaceholderPatterns | string[] | Patrones regex extra (hinda delimitadores) agregados jar conjunto marcador ya posición predeterminado, nt'udi, <<.+?>> pa ar sintaxis ar ficha personalizada. Ya regex hindi válidos ar ignoran. |
noTranslatePatterns | string[] | Patrones globo coincidieron ko ya claves za̲ ár nthe̲ analizador (JSON trazado puntos, RESX name, PO msgid, XLIFF ar xe̲ni id, INI yá restext clave). Claves coincidentes ar caen ar zohni 'nehe ne thogi ko ár hmädi fuente preservado. |
Ya carga
- Ar nt'ot'e gi lei entradas explícitas ar flujo ar 'be̲fi.
- Carga ar configuración YAML ar
configPath. - Pa kadu̲ 'nar hwähi compartido, ar entrada gana; Ar nä'ä contrario ar gi japu̲'be̲fi ár hmädi YAML.
- Ya valores fusionados ar validan. Enumeraciones hindi válidas (nt'udi,
profanityAction: Mask) provocan ke ar nt'ot'e falle ngutha ko 'nar 'me̲hni neki.
Wa ar ñhöñhö ne ar industria, jar ngäts'i sencillos
Ar API Azure AI Translator v3 hingi pe̲ts'i 'nar sola nunä wa ar ñhöñhö. Yoho ya ajustes combinan pa uni mäs ndunthe xkagentho ar control:
- Industria yá dominio: Utilice
categoryIdpa señalar 'nar categoría Custom Translator Azure entrenada jar propio ár corpus — legal, técnico, médico, marketing wa 'na gi xka. Nuna gehna ar palanca xí nze̲di pa ar wa ar ñhöñhö, ar hñä ar marca ne ar nthuts'i ya texto. - Texto superficie: Utilice ar Glosario pa bloquear thuhuu marcas ne ngäts'i productos literalmente, ne utilizar
profanityActionpa fregar ngäts'i profanos ja ar dirigir ar localización pa audiencias mäs bätsitho.