رستي کي configPath ان پٽ سان اوور رائڊ ڪريو جيڪڏهن توهان کي غير ڊفالٽ جڳهه جي ضرورت آهي.
اسڪيما
# .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.*"فيلڊ جو حوالو
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.
sourceLocaleجيڪڏهن سيٽ نه ڪيو ويو ته sourceLocale ان پٽ ڏانهن واپس اچي ٿو. مترجم ڏانهن پڻ اڳتي وڌايو ويو آهي جيئن from=<locale> ته مختصر تارن کي پاڻمرادو معلوم نه ڪيو ويو آهي.
toLocalesيا ته هڪ صف يا ڪاما کان ڌار ٿيل تار.
include / excludeگلوب پيٽرن کي مطلق ۽ ڪم جي جڳهه جي حوالي سان رستن جي خلاف تشخيص ڪئي وئي آهي.
glossaryترجمي کان پوءِ اصطلاح ختم ٿي وڃي ٿي. لفظ جي حد کان آگاهي (هينڊلز C++ ، .NET)
categoryIdAzure Custom Translator ڪيٽيگري — توهان جي صنعت / ڊومين نوب (قانوني ، طبي ، مارڪيٽنگ ٽون ، وغيره). ?category=... طور موڪليو ويو.
textTypeڊفالٽ کي plain html استعمال ڪريو صرف ان صورت ۾ جيڪڏهن توهان جي وسيلن جي قدرن ۾ حقيقي HTML ٽڪرا شامل آهن.
profanityActionترجمو ٿيل آئوٽ پٽ ۾ گستاخ اصطلاحن جو علاج ڪيئن ڪجي
profanityMarkerصرف معنيٰ وارو آهي جڏهن profanityAction "Marked" آهي.
allowFallbackترجمي کي ناڪام ڪرڻ لاءِ false تي سيٽ ڪريو جڏهن توهان جي categoryId کي عام ماڊل ڏانهن واپس اچڻ بدران ٽارگيٽ لوڪل لاءِ ڪا تعیناتي نه آهي.
apiVersionمترجم REST API ورزن ڊفالٽ کي 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.
maxRetriesعارضي HTTP جوابن تي وڌ کان وڌ ٻيهر ڪوشش ڪرڻ جي ڪوشش (408, 425, 429, 500, 502, 503, 504) ڊفالٽ کي 5 ڪل HTTP ڪالون في درخواست 1 + maxRetries آهن.
retryBackoffMsڪيپ (ايم ايس) ڪنهن به واحد پٺتي پيل ننڊ تي. ڊفالٽ کي 30000 Azure جي Retry-After هيڊر کي عزت ڏني وئي آهي بلڪل جڏهن موجود آهي؛ ٻي صورت ۾ jittered exponential backoff استعمال ڪيو ويندو آهي، هن قيمت تي بند ڪيو ويو آهي.
protectPlaceholdersڊفالٽ کي true جڏهن آن ، ٽوڪن جهڙوڪ {{name}} ، ${var} ، {0} ، {0:N2} ، %s ، %1$s ۽ HTML ادارن کي ترجمي کان پهريان سينٽينل ٽوڪن سان تبديل ڪيو ويندو آهي ۽ بعد ۾ بحال ڪيو ويندو آهي. صرف ان صورت ۾ غير فعال ڪريو جڏهن ماخذ ارادي طور تي جڳهه هولڊر جي شڪل واري لفظي تي مشتمل هجي.
customPlaceholderPatternsاضافي ريگڪس پيٽرن (بغير ڊيليميٽرز جي) ڊفالٽ پليس هولڊر سيٽ ۾ شامل ڪيو ويو ، مثال طور ڪسٽم ٽوڪن نحو لاءِ <<.+?>>. ناجائز ريگڪس کي نظرانداز ڪيو ويندو آهي.
noTranslatePatternsگلوب پيٽرن کي پارسر سطح جي چابين سان ملايو ويو آهي (JSON dotted رستو ، RESX name ، PO msgid ، XLIFF يونٽ id ، INI / restext ڪيچ). ملندڙ چابيون درخواست مان ڪ areيون ويون آهن ۽ انهن جي ماخذ قيمت محفوظ سان گذري وينديون آهن.
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.
لوڊ ٿي رهيو آهي
- عمل ڪم جي فلو مان واضح ان پٽ پڙهي ٿو.
- اهو
configPathکان YAML config لوڊ ڪري ٿو. - هر گڏيل فيلڊ لاءِ ، ان پٽ کٽي ٿو ؛ ٻي صورت ۾ YAML قدر استعمال ڪيو ويندو آهي.
- ضم ٿيل قدر صحيح آهن. ناجائز اينمس (مثال طور
profanityAction: Mask) هڪ واضح پيغام سان عمل کي تيز ناڪام ڪرڻ جو سبب بڻجن ٿا.
ٽون ۽ انڊسٽري ، سادي لفظن ۾
Azure AI Translator v3 API وٽ هڪ ٽون نوب نه آهي. ٻه سيٽنگون توهان کي گهڻو ڪري ساڳيو ڪنٽرول ڏيڻ لاءِ گڏ ٿين ٿيون:
- انڊسٽري / ڊومين: توهان جي پنهنجي ڪورپس تي تربيت يافته Azure Custom Translator ڪيٽيگري ڏانهن اشارو ڪرڻ لاءِ
categoryIdاستعمال ڪريو - قانوني ، فني ، طبي ، مارڪيٽنگ يا ٻيو ڪجهه. اهو لهجي ، برانڊ آواز ۽ لفظي ذخيري لاءِ سڀ کان مضبوط ليور آهي. - مٿاڇري جو متن: برانڊ جا نالا ۽ پراڊڪٽ جي اصطلاحن کي لفظي طور تي لاڪ ڪرڻ لاءِ لغت استعمال ڪريو ، ۽ نن audienceن سامعين لاءِ لوڪلائيزيشن کي نشانو بڻائڻ وقت گستاخ اصطلاحن کي صاف ڪرڻ لاءِ
profanityActionاستعمال ڪريو.