စံထားချက်မဟုတ်တဲ့ တည်နေရာတခုလိုအပ်တယ်ဆိုရင် 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[] | Glob ပုံစံများကို အကြွင်းမဲ့နှင့် အလုပ်ခွင်နှင့်နှိုင်းယှဉ်သော လမ်းကြောင်းများကို ဆန့်ကျင်၍ အကဲဖြတ်ခဲ့သည်။ |
glossary | map<string,string> | ဘာသာပြန်ပြီးတဲ့နောက် အသုံးအနှုန်းကို အစားထိုးတယ်။ စကားလုံးနယ်နိမိတ်ကို သတိပြုမိခြင်း (လက်ကိုင် C++, .NET). |
categoryId | string | Azure Custom Translator အမျိုးအစား — သင့်စက်မှု/ဒိုမိန်း လက်ကိုင် (တရားဥပဒေ၊ ဆေးဘက်ဆိုင်ရာ၊ ဈေးကွက်လေသံ စသည်များ) ?category=... အနေဖြင့် ပို့လိုက်သည်။ |
textType | "plain" | "html" | စံထားချက်ကို plain html တန်ဖိုးများတွင် HTML အပိုင်းအစအစစ်အမှန်ပါဝင်မှသာ အသုံးပြုပါ။ |
profanityAction | "NoAction" | "Marked" | "Deleted" | ဘာသာပြန်ထုတ်ဝေမှုတွင် ညစ်ညမ်းသောဝေါဟာရများကို မည်သို့ကိုင်တွယ်နိုင်ပုံ။ |
profanityMarker | "Asterisk" | "Tag" | ၎င်း သည် profanityAction ဖြစ် သောအခါ သာ အဓိပ္ပာယ် ရှိ "Marked" ။ |
allowFallback | boolean | ယေဘုယျ မော်ဒယ်သို့ ပြန်ကျသွားမည့်အစား သင့် categoryId ရည်မှန်းထားသော နေရာတခုအတွက် ဖြန့်ချိမှုမရှိသည့်အခါ ဘာသာပြန်မှု ပျက်ကွက်ရန် false သတ်မှတ်ပါ။ |
apiVersion | string | ဘာသာပြန်သူ REST API ဗားရှင်း။ စံထားချက်ကို 3.0 |
maxRetries | integer | ခေတ္တ HTTP တုံ့ပြန် မှု များ အပေါ် အများဆုံး ပြန်လည် ကြိုးစား မှု များ ( 408, 425, 429, 500, 502, 503, 504 ) ။ စံထားချက်ကို 5 တောင်းဆိုချက်တစ်ခုစီ HTTP ခေါ်ဆိုမှုစုစုပေါင်း 1 + maxRetries |
retryBackoffMs | integer | တစ်ကြိမ်တည်းအိပ်စက်ခြင်းတွင် အကန့်အသတ် (ms) ဖြစ်သည်။ စံထားချက်ကို 30000 အက်ဇူရီ ၏ Retry-After ခေါင်းစီး ကို ရောက် ရှိ သောအခါ အတိအကျ ဂုဏ်ပြု ခဲ့ သည် ။ သို့မဟုတ်လျှင် တုန်လှုပ်ချောက်ချားသော အညွှန်း နောက်ကျောခြင်းကို အသုံးပြုပြီး ဤတန်ဖိုးကို ကန့်သတ်ထားသည်။ |
protectPlaceholders | boolean | စံထားချက်ကို true ဖွင့် သောအခါ ၊ {{name}} ၊ ${var} ၊ {0} ၊ {0:N2} ၊ %s ၊ %1$s နှင့် အိတ်ခ်ျ ကဲ့သို့ အမှတ်အသား များ ကို ဘာသာပြန် ခြင်း မတိုင်မီ အစောင့် အမှတ်အသား များ ဖြင့် အစားထိုး ပြီး နောက်ပိုင်း တွင် ပြန်လည် ပြုပြင် ခဲ့ သည် ။ အရင်းအမြစ်တွင် နေရာယူပုံသဏ္ဌာန် စာသားများ တမင်တကာ ပါဝင်မှသာ ခွင့်မပြုပါ။ |
customPlaceholderPatterns | string[] | ဥပမာ၊ စိတ်ကြိုက် token သင်္ကေတအတွက် <<.+?>> စံထားချက် နေရာယူသူ အစုအနားသို့ အပိုregex ပုံစံများ ထည့်သွင်းထားသည်။ မမှန်တဲ့ regexes ကို လျစ်လျူရှုထားတယ်။ |
noTranslatePatterns | string[] | Glob ပုံစံ များ သည် parser-level key များ (JSON အစက် လမ်းကြောင်း ၊ RESX name , PO msgid , XLIFF ယူနစ် id , INI / restext key ) နှင့် ကိုက် ညီ သည် ။ ကိုက်ညီသောသော့များကို တောင်းဆိုချက်မှ ဖြုတ်ချပြီး ၎င်းတို့၏ အရင်းအမြစ်တန်ဖိုးကို ထိန်းသိမ်းထားသည်။ |
ဖွင့်နေသည့်အစဉ်
- လုပ်ဆောင်မှုသည် အလုပ်လုပ်စဉ်မှ ရှင်းလင်းသော အဝင်များကို ဖတ်ပြသည်။
- YAML config ကို
configPathဖွင့်ပေးတယ်။ - မျှဝေထားသော နယ်ပယ်တိုင်းအတွက် အသုံးဝင်မှုသည် အနိုင်ရသည်။ သို့မဟုတ်လျှင် YAML တန်ဖိုးကို သုံးစွဲသည်။
- ပေါင်းစပ်ထားသော တန်ဖိုးများကို အတည်ပြုသည်။ မမှန်သော enums (ဥပမာ၊
profanityAction: Mask) သည် ရှင်းလင်းသော သတင်းစကားနှင့်အတူ လုပ်ဆောင်မှုကို လျင်မြန်စွာ ကျၡုံးစေသည်။
လေသံနှင့် စက်မှုလုပ်ငန်းကို ရိုးရှင်းစွာပြောရလျှင်
Azure AI Translator v3 API တွင် အသံ လက်ကိုင် တစ် ခု မ ရှိ ပါ ။ တူညီသော ထိန်းချုပ်မှုအများစုကို ပေးရန် ဆက်သွယ်မှုနှစ်ခုကို ပေါင်းစပ်ထားသည်။
- စက်မှု / နယ်ပယ် -
categoryIdကိုသုံးပြီး သင့်ကိုယ်ပိုင် သင်္ကေတပေါ်တွင် လေ့ကျင့်ထားသော Azure Custom Translator အမျိုးအစားကို ညွှန်ပြရန် ဥပဒေ၊ နည်းပညာ၊ ဆေးဘက်ဆိုင်ရာ၊ ဈေးကွက် သို့မဟုတ် အခြားမည်သည့်အရာကိုမဆို ညွှန်ပြပါ။ ယင်းသည် လေသံ၊ တံဆိပ်အသံနှင့် ဝေါဟာရများအတွက် အစွမ်းထက်ဆုံးနည်းဖြစ်သည်။ - မျက်နှာပြင်စာသား- အဘိဓာန်အဘိဓာန် ကို အသုံးပြု ၍ တံဆိပ် အမည် များ နှင့် ထုတ်ကုန် အသုံးအနှုန်း များ ကို လုံးလုံးလျားလျား သော့ခတ် ပြီး ၊ ငယ်ရွယ် သော ပရိသတ် များ အတွက် ဒေသခံ သတ်မှတ် ချက် ကို ပစ်မှတ် ထား သောအခါ ညစ်ညမ်း သော အသုံးအနှုန်း များ ကို ဖယ်ရှား ရန်
profanityActionကို အသုံးပြု ပါ ။