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