A mono i te e'a e te configPath mai te mea e hinaaro outou i te hoê vahi e ere i te mea matauhia.
Hoho'a
# .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.*"Faahororaa no te tuhaa fenua
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.
sourceLocaleE ho'i mai i ni'a i te sourceLocale mai te mea e, aita i haamauhia. E hapono-atoa-hia i te Translator ei from=<locale> ia ore te mau taura poto e ite-noa-hia.
toLocalesTe hoê anairaa anei e aore râ, te hoê taura tei faataa-ê-hia e te vira.
include / excludeTe mau hoho'a o te glob tei hi'opo'ahia ia au i te mau e'a papû e te vahi ohiparaa.
glossaryTe mau ta'o i muri a'e i te iritiraa. Haapa'o i te oti'a o te ta'o (e haapa'o i te C++, .NET).
categoryIdAzure Custom Translator category — ta outou tuhaa ohipa (ture, rapaauraa, tapihooraa, e te tahi atu â). Haponohia mai te ?category=....
textTypeE tano i te plain. A faaohipa i te html mai te mea te vai ra te mau hu'ahu'a HTML mau i roto i ta outou mau faufaa.
profanityActionNahea ia faaohipa i te mau parau faufau i roto i te iritiraa.
profanityMarkerE mea faufaa noa ia profanityAction i te "Marked".
allowFallbackA faanaho i ni'a i te false ia ore e manuïa i te iritiraa mai te mea e, aita ta outou categoryId e faaohipahia no te hoê vahi opuaraa, eiaha râ e ho'i faahou i ni'a i te hoho'a rahi.
apiVersionTranslator REST API version. E tano i te 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.
maxRetriesRahiraa tamataraa no te tamata faahou i ni'a i te mau pahonoraa HTTP poto (408, 425, 429, 500, 502, 503, 504). E tano i te 5. Te taatoaraa o te mau niuniu HTTP i te aniraa tata'itahi, e 1 + maxRetries ïa.
retryBackoffMsA tapo'i (ms) i ni'a i te hoê noa taotoraa. E tano i te 30000. E faahanahanahia te upoo parau Retry-After Azure i te taime ti'a ; aita ana'e, e faaohipahia te backoff exponential jittered, taoti'ahia i teie faufaa.
protectPlaceholdersE tano i te true. Mai te mea e, e monohia te mau token mai te {{name}}, ${var}, {0}, {0:N2}, %s, %1$s e HTML e te mau token sentinel hou te iritiraa e e faaho'ihia mai i muri iho. A tupohe noa mai te mea e, te vai ra te mau parau mau i roto i te tumu parau.
customPlaceholderPatternsTe tahi atu mau hoho'a regex (aita e taoti'araa) tei tuuhia i ni'a i te faanahoraa placeholder, ei hi'oraa, <<.+?>> no te syntax o te token. Aita te mau regex tano ore e tau'a-ore-hia.
noTranslatePatternsTe mau hoho'a glob e tu'ati i ni'a i te mau taviri parser (JSON dotted path, RESX name, PO msgid, XLIFF unit id, INI/restext key). E faaru'ehia te mau taviri tu'ati mai roto mai i te aniraa e e faahereherehia te faufaa tumu.
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.
Faanahoraa no te faautaraa
- E tai'o te ohipa i te mau mana'o papû no roto mai i te tereraa ohipa.
- E faauta te reira i te faanahoraa YAML mai te
configPath. - No te mau tuhaa tata'itahi, e upooti'a te mana'o ; aita ana'e, e faaohipahia te faufaa YAML.
- E haamanahia te mau faufaa amuihia. E faatupu te mau enum hape (ei hi'oraa,
profanityAction: Mask) i te manuïa vitiviti o te ohipa na roto i te hoê poro'i maramarama.
Te ta'iraa e te ohipa, i roto i te mau parau ohie
Aita e pitopito ta'iraa i roto i te Azure AI Translator v3 API. E piti faanahoraa e amuihia no te horo'a ia outou i te hoê â hi'opo'araa :
- Ohipa / tuhaa : a faaohipa i te
categoryIdno te faatoro i te hoê tuhaa Azure Custom Translator tei haapiipiihia i ni'a i ta outou iho faanahoraa — i te pae no te ture, i te pae aravihi, i te pae rapaauraa, i te tapihooraa, e aore râ, i te tahi atu mea. Teie te rave'a puai roa a'e no te ta'iraa, te reo e te ta'o. - Papa'iraa i ni'a i te papa'iraa : A faaohipa i te Glossary no te ponao i te mau i'oa o te mau tao'a e te mau parau no te mau tauihaa e a faaohipa i te
profanityActionno te tamâ i te mau parau faufau no te faanaho i te vahi no te feia apî.