જો તમને બિન-મૂળભૂત સ્થાનની જરૂર હોય તો 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).
categoryIdએઝ્યુર 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ક્ષણિક HTTP પ્રત્યુત્તરો પર મહત્તમ પુન:પ્રયત્નો (408, 425, 429, 500, 502, 503, 504). 5 માટે મૂળભૂત છે. વિનંતી દીઠ કુલ HTTP કૉલ્સ 1 + maxRetries છે.
retryBackoffMsકોઈપણ એક બેકઓફ ઊંઘ પર કેપ (એમએસ). 30000 માટે મૂળભૂત છે. એઝ્યુરના Retry-After હેડરને બરાબર સન્માનિત કરવામાં આવે છે જ્યારે હાજર છે; અન્યથા ભ્રષ્ટ ઘાતાંકીય બેકઑફનો ઉપયોગ કરવામાં આવે છે, જે આ મૂલ્ય પર કેપ્ડ થાય છે.
protectPlaceholderstrue માટે મૂળભૂત છે. જ્યારે ચાલુ હોય, ત્યારે {{name}}, ${var}, {0}, {0:N2}, %s, %1$s અને એચટીએમએલ એન્ટિટીઝ જેવા ટોકન્સને અનુવાદ પહેલાં સેન્ટિનલ ટોકન્સ સાથે બદલવામાં આવે છે અને પછી પુનઃસ્થાપિત કરવામાં આવે છે. જ્યારે સ્ત્રોત ઇરાદાપૂર્વક પ્લેસહોલ્ડર-આકારના શાબ્દિક સમાવે ત્યારે જ નિષ્ક્રિય કરો.
customPlaceholderPatternsડિફોલ્ટ પ્લેસહોલ્ડર સેટમાં વધારાની રેજેક્સ પેટર્ન (ડિલિમિટર્સ વિના) ઉમેરવામાં આવી છે, દા.ત. વૈવિધ્યપૂર્ણ ટોકન વાક્યરચના માટે <<.+?>>. અયોગ્ય regexes અવગણવામાં આવે છે.
noTranslatePatternsGlob ભાતો પાર્સર-સ્તર કીઓ (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.
ક્રમ લાવી રહ્યા છે
- ક્રિયા વર્કફ્લોમાંથી સ્પષ્ટ ઇનપુટ્સ વાંચે છે.
- તે
configPathમાંથી YAML રૂપરેખાંકન લોડ કરે છે. - દરેક વહેંચાયેલ ક્ષેત્ર માટે, ઇનપુટ જીતે છે; અન્યથા YAML મૂલ્યનો ઉપયોગ કરવામાં આવે છે.
- ભેગા થયેલ મૂલ્યો માન્ય થયેલ છે. અયોગ્ય enums (દા.ત.
profanityAction: Mask) સ્પષ્ટ સંદેશ સાથે ક્રિયાને ઝડપથી નિષ્ફળ જવાનું કારણ બને છે.
સ્વર અને ઉદ્યોગ, સાદા શબ્દોમાં
Azure AI Translator v3 API પાસે એક ટોન નોબ નથી. બે સેટિંગ્સ તમને મોટા ભાગના સમાન નિયંત્રણ આપવા માટે ભેગા થાય છે:
- ઉદ્યોગ / ડોમેઇન: તમારા પોતાના કોર્પસ - કાયદેસર, તકનીકી, તબીબી, માર્કેટિંગ અથવા બીજું કંઈપણ - એઝ્યુર Custom Translator કેટેગરી તરફ નિર્દેશ કરવા માટે
categoryIdનો ઉપયોગ કરો. સ્વર, બ્રાન્ડ અવાજ અને શબ્દભંડોળ માટે આ સૌથી મજબૂત લિવર છે. - સપાટી લખાણ: બ્રાન્ડ નામો અને ઉત્પાદનની શરતોને શાબ્દિક રીતે લૉક કરવા માટે ગ્લોસરી નો ઉપયોગ કરો, અને નાના પ્રેક્ષકો માટે સ્થાનિકીકરણને લક્ષ્ય બનાવતી વખતે અભદ્ર શબ્દોને સ્ક્રબ કરવા માટે
profanityActionનો ઉપયોગ કરો.