जँ अहाँ केँ गैर मूलभूत स्थान चाही तँ 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=... रूपमे भेजल गेल।
textTypeplain मे डिफॉल्ट. 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क्षणिक एचटीटीपी अनुक्रियासभ पर फिनु सँ बेसी फिनु सँ कोसिस कोसिस (408, 425, 429, 500, 502, 503, 504). 5 मे डिफॉल्ट. प्रति अनुरोध कुल एचटीटीपी कॉल 1 + maxRetries।
retryBackoffMsकोनो एकल बैकऑफ निन्न पर कैप (एमएस)। 30000 मे डिफॉल्ट. Azure के Retry-After हेडर के ठीक तखन सम्मानित कएल जाइत अछि जखन उपस्थित रहैत अछि; अन्यथा घबराएल घातांकीय बैकऑफ प्रयोग कएल जाइत अछि, एहि मान पर कैप कएल जाइत अछि।
protectPlaceholderstrue मे डिफॉल्ट. चालू भेलापर, {{name}}, ${var}, {0}, {0:N2}, %s, %1$s आ HTML एंटिटी जेहन टोकनकेँ अनुवादसँ पहिने सेंटिनल टोकनसँ बदलि देल जाइत अछि आ बादमे पुनर्स्थापित कएल जाइत अछि। तखन निष्क्रिय करू जखन स्रोतमे जानिबूझि कए प्लेसहोल्डर आकारक लिटरल हो।
customPlaceholderPatternsअतिरिक्त रेगेक्स पैटर्न (बिना सीमांकक) मूलभूत प्लेसहोल्डर सेटमे जोड़ल गेल, उदा. कस्टम टोकन सिंटेक्सक लेल <<.+?>>. अवैध रेजीएक्स अनदेखा कएल गेल.
noTranslatePatternsग्लोब पैटर्न पार्सर-स्तरीय कुँजी (JSON बिन्दु पथ, RESX name, PO msgid, XLIFF एकाइ id, INI/restext कुंजी) सँ मेल खाइत अछि. मिलान कुँजीकेँ अनुरोधसँ हटा देल जाइत अछि आ ओकर स्रोत मान संरक्षित राखि कऽ पास कएल जाइत अछि।
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.
क्रम लोड कए रहल अछि
- क्रिया कार्यप्रवाहसँ स्पष्ट इनपुट पढ़ैत अछि।
- ई YAML विन्यासकेँ
configPathसँ लोड करैत अछि। - प्रत्येक साझा क्षेत्रक लेल, इनपुट जीतैत अछि; अन्यथा YAML मान प्रयोग कएल जाइत अछि।
- मिलाएल गेल मूल्य मान्य अछि. अमान्य एनम (उदा.
profanityAction: Mask) स्पष्ट संदेशक सँग क्रियाकेँ तेजी सँ विफल करैत अछि।
स्वर आ उद्योग, स्पष्ट शब्दमे
Azure AI Translator v3 API मे एकटा टोन नॉब नहि अछि। दूटा सेटिंग मिलबैत अछि जे अहाँकेँ बेसी सँ बेसी एकहि नियंत्रण दैत अछि:
- उद्योग / डोमेन: अपन स्वयं के कॉर्पस पर प्रशिक्षित Azure Custom Translator श्रेणी के इंगित करबाक लेल
categoryIdके उपयोग करू — कानूनी, तकनीकी, चिकित्सा, विपणन, या किछु आओर किछु। टोन, ब्रान्ड आवाज आ शब्दावलीक लेल ई सभसँ मजबूत लीवर अछि। - सतह केर पाठ: ब्रान्ड नाम आ उत्पाद शब्दकेँ शब्दशः लॉक करबाक लेल शब्दावली प्रयोग करू, आ युवा दर्शकसभक लेल स्थानीयकरणकेँ लक्षित करैत काल अभद्र शब्दकेँ रगड़बाक लेल
profanityActionप्रयोग करू।