જો તમને બિન-મૂળભૂત સ્થાનની જરૂર હોય તો configPath ઇનપુટ સાથે પાથ પર ફરીથી રાઇડ કરો.
યોજના
# .github/resource-translator.ymlsourceLocale: entoLocales: - fr - de - esinclude: - "src/**/*.en.json" - "apps/**/*.en.resx"exclude: - "**/__tests__/**"glossary: Acme: Contoso Octocat: Octocat # keep brand names verbatim
# Domain / industry — uses an Azure Custom Translator category trained on# your tone and vocabulary. Leave unset for the general model.categoryId: my-custom-translator-category
# Translator request shape — most users can ignore these.textType: plain # plain | htmlprofanityAction: NoAction # NoAction | Marked | DeletedprofanityMarker: Asterisk # Asterisk | Tag (only when profanityAction == Marked)allowFallback: true # false fails when the categoryId has no deployment
apiVersion: "3.0"
# 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.*"ક્ષેત્ર સંદર્ભ
| ક્ષેત્ર | પ્રકાર | નોંધો |
|---|---|---|
sourceLocale | string | જો સુયોજિત ન હોય તો sourceLocale ઇનપુટ પર પાછા પડે છે. અનુવાદકને પણ મોકલવામાં આવે છે from=<locale> જેથી ટૂંકા શબ્દમાળાઓ સ્વયં શોધી શકાય નહીં. |
toLocales | string[] | ક્યાં તો એરે અથવા અલ્પવિરામથી અલગ થયેલ શબ્દમાળા. |
include / exclude | string[] | ગ્લોબ પેટર્નનું મૂલ્યાંકન નિરપેક્ષ અને વર્કસ્પેસ-સંબંધિત પાથ સામે કરવામાં આવ્યું હતું. |
glossary | map<string,string> | અનુવાદ પછીની શબ્દ ઓવરરાઇડ કરે છે. શબ્દ-સીમા જાગૃત (હેન્ડલ્સ C++, .NET). |
categoryId | string | એઝ્યુર Custom Translator કેટેગરી - તમારો ઉદ્યોગ / ડોમેન નોબ (કાયદેસર, તબીબી, માર્કેટિંગ ટોન, વગેરે). ?category=... તરીકે મોકલેલ છે. |
textType | "plain" | "html" | plain માટે મૂળભૂત છે. ફક્ત ત્યારે જ html વાપરો જો તમારી સ્ત્રોત કિંમતો વાસ્તવિક HTML ટુકડાઓ સમાવે છે. |
profanityAction | "NoAction" | "Marked" | "Deleted" | અનુવાદિત આઉટપુટમાં અભદ્ર શબ્દોની સારવાર કેવી રીતે કરવી. |
profanityMarker | "Asterisk" | "Tag" | જ્યારે profanityAction "Marked" હોય ત્યારે જ અર્થપૂર્ણ છે. |
allowFallback | boolean | અનુવાદ નિષ્ફળ થવા માટે false માટે સુયોજિત કરો જ્યારે તમારા categoryId પાસે સામાન્ય મોડેલ પર પાછા પડવાને બદલે લક્ષ્ય લોકેલ માટે કોઈ જમાવટ નથી. |
apiVersion | string | અનુવાદક REST API સંસ્કરણ. 3.0 માટે મૂળભૂત છે. |
maxRetries | integer | ક્ષણિક HTTP પ્રત્યુત્તરો પર મહત્તમ પુન:પ્રયત્નો (408, 425, 429, 500, 502, 503, 504). 5 માટે મૂળભૂત છે. વિનંતી દીઠ કુલ HTTP કૉલ્સ 1 + maxRetries છે. |
retryBackoffMs | integer | કોઈપણ એક બેકઓફ ઊંઘ પર કેપ (એમએસ). 30000 માટે મૂળભૂત છે. એઝ્યુરના Retry-After હેડરને બરાબર સન્માનિત કરવામાં આવે છે જ્યારે હાજર છે; અન્યથા ભ્રષ્ટ ઘાતાંકીય બેકઑફનો ઉપયોગ કરવામાં આવે છે, જે આ મૂલ્ય પર કેપ્ડ થાય છે. |
protectPlaceholders | boolean | true માટે મૂળભૂત છે. જ્યારે ચાલુ હોય, ત્યારે {{name}}, ${var}, {0}, {0:N2}, %s, %1$s અને એચટીએમએલ એન્ટિટીઝ જેવા ટોકન્સને અનુવાદ પહેલાં સેન્ટિનલ ટોકન્સ સાથે બદલવામાં આવે છે અને પછી પુનઃસ્થાપિત કરવામાં આવે છે. જ્યારે સ્ત્રોત ઇરાદાપૂર્વક પ્લેસહોલ્ડર-આકારના શાબ્દિક સમાવે ત્યારે જ નિષ્ક્રિય કરો. |
customPlaceholderPatterns | string[] | ડિફોલ્ટ પ્લેસહોલ્ડર સેટમાં વધારાની રેજેક્સ પેટર્ન (ડિલિમિટર્સ વિના) ઉમેરવામાં આવી છે, દા.ત. વૈવિધ્યપૂર્ણ ટોકન વાક્યરચના માટે <<.+?>>. અયોગ્ય regexes અવગણવામાં આવે છે. |
noTranslatePatterns | string[] | Glob ભાતો પાર્સર-સ્તર કીઓ (JSON ડોટેડ પાથ, RESX name, PO msgid, XLIFF એકમ id, INI / restext કી) સામે બંધબેસે છે. મેચિંગ કીઓ વિનંતીમાંથી છોડી દેવામાં આવે છે અને તેમના સ્રોત મૂલ્ય સાચવવામાં આવે છે. |
ક્રમ લાવી રહ્યા છે
- ક્રિયા વર્કફ્લોમાંથી સ્પષ્ટ ઇનપુટ્સ વાંચે છે.
- તે
configPathમાંથી YAML રૂપરેખાંકન લોડ કરે છે. - દરેક વહેંચાયેલ ક્ષેત્ર માટે, ઇનપુટ જીતે છે; અન્યથા YAML મૂલ્યનો ઉપયોગ કરવામાં આવે છે.
- ભેગા થયેલ મૂલ્યો માન્ય થયેલ છે. અયોગ્ય enums (દા.ત.
profanityAction: Mask) સ્પષ્ટ સંદેશ સાથે ક્રિયાને ઝડપથી નિષ્ફળ જવાનું કારણ બને છે.
સ્વર અને ઉદ્યોગ, સાદા શબ્દોમાં
Azure AI Translator v3 API પાસે એક ટોન નોબ નથી. બે સેટિંગ્સ તમને મોટા ભાગના સમાન નિયંત્રણ આપવા માટે ભેગા થાય છે:
- ઉદ્યોગ / ડોમેઇન: તમારા પોતાના કોર્પસ - કાયદેસર, તકનીકી, તબીબી, માર્કેટિંગ અથવા બીજું કંઈપણ - એઝ્યુર Custom Translator કેટેગરી તરફ નિર્દેશ કરવા માટે
categoryIdનો ઉપયોગ કરો. સ્વર, બ્રાન્ડ અવાજ અને શબ્દભંડોળ માટે આ સૌથી મજબૂત લિવર છે. - સપાટી લખાણ: બ્રાન્ડ નામો અને ઉત્પાદનની શરતોને શાબ્દિક રીતે લૉક કરવા માટે ગ્લોસરી નો ઉપયોગ કરો, અને નાના પ્રેક્ષકો માટે સ્થાનિકીકરણને લક્ષ્ય બનાવતી વખતે અભદ્ર શબ્દોને સ્ક્રબ કરવા માટે
profanityActionનો ઉપયોગ કરો.