Takahi i te ara ki te tāuru configPath mēnā e hiahia ana koe ki tētahi tauwāhi taunoa-kore.
Aronuinga
# .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.*"Tohutoro āpure
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.
sourceLocaleKa hoki whakamuri ki te tāuru sourceLocale ki te kore e tautuhia. Ka whakamua hoki ki te Kaiwhakamāori hei from=<locale> kia kore ai ngā aho poto e kiteanoatia.
toLocalesHe huānga, he aho whakawehe-piko rānei.
include / excludeNgā tauira glob i arotakea ki ngā ara pūmau me ngā ara pātahi mokowāmahi.
glossaryNgā takahitanga kupu i muri i te whakamāoritanga. E mōhio ana ki te rohenga-kupu (ka raweke i te C++, .NET).
categoryIdKāwai Custom Translator Azure — tō pona umanga/rohe (ā-ture, rongoā, oro mākete, aha atu). I tukua hei ?category=....
textTypeTaunoa ai ki te plain. Whakamahia html anake mēnā he kongakonga HTML tūturu kei ō uara rauemi.
profanityActionMe pēhea te whakamahi i ngā kupu whakarihariha i roto i te huaputa kua whakamāoritia.
profanityMarkerWhai tikanga anake ina profanityAction "Marked".
allowFallbackTautuhia ki te false kia rahua te whakawhitinga ina kore tō categoryId e tuku mō tētahi wāhi ūnga, kaua e hoki whakamuri ki te tauira ahuwhānui.
apiVersionPutanga REST API kaiwhakamāori. Taunoa ai ki 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.
maxRetriesKo te mōrahi o ngā nganatanga ngana anō i runga i ngā urupare HTTP rangitahi (408, 425, 429, 500, 502, 503, 504). Taunoa ai ki te 5. He 1 + maxRetries te tapeke o ngā waea HTTP mō ia tono.
retryBackoffMsPū (ms) i runga i tētahi moe whakamuri kotahi. Taunoa ai ki te 30000. Ka whakahonoretia te pane Retry-After o Azure i te wā i konei; ki te kore ka whakamahia te whakahoki taupua āmaimai, ka whakawhāititia ki tēnei uara.
protectPlaceholdersTaunoa ai ki te true. Ina kā ana, ka whakakapia ngā maimai pēnei i te {{name}}, ${var}, {0}, {0:N2}, %s, %1$s me ngā mea HTML ki ngā maimai sentinel i mua i te whakamāoritanga, ā, ka whakaoratia i muri iho. Monokia anake mēnā kei roto i te pūtake ngā āhuatanga puriwāhi.
customPlaceholderPatternsKua tāpirihia ētahi atu tauira regex (me te kore kaiwehe) ki te huinga puriwāhi taunoa, hei tauira, <<.+?>> mō te wetereo maimai ritenga. Ka waihotia ngā kōrero kōrero muhu.
noTranslatePatternsKo ngā tauira glob e ōrite ana ki ngā kī taumata-parser (ara iraira JSON, RESX name, PO msgid, XLIFF unit id, kī INI/restext). Ka whakatakahia ngā kī ōrite mai i te tono, ā, ka puta atu me te uara pūtake e pupuritia ana.
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.
Uta ana i te raupapa
- Ka pānui te hohenga i ngā tāurunga mārama mai i te rerengamahi.
- Ka utaina te whirihoranga YAML mai i
configPath. - Mō ia āpure tiritiri, ka toa te tāuru; ki te kore ka whakamahia te uara YAML.
- Kua whakamanatia ngā uara hanumi. Mā ngā tau muhu (hei tauira,
profanityAction: Mask) ka rahua tere te hohenga me tētahi karere ūkui.
Oro me te mahi, i roto i ngā kupu māmā
Kāore he pona oro kotahi o te Azure AI Translator v3 API. E rua ngā tautuhinga e paheko ana hei hoatu i te nuinga o te mana ōrite:
- Ahumahi / rohe: whakamahia
categoryIdhei tohu i tētahi kāwai Azure Custom Translator kua whakaakona ki tō ake huinga — ā-ture, hangarau, rongoā, mākete, tētahi atu mea rānei. Koinei te kōwhiti tino kaha mō te oro, te reo parani, me te kupu. - Kuputuhi mata: Whakamahia te pukapuka kupu hei maukati i ngā ingoa parani me ngā kupu hua kuputuhi, me te whakamahi i te
profanityActionhei horoi i ngā kupu whakarihariha ina whakarite i te whakawāteatanga mō ngā kaimātakitaki tamariki.