ነባሪ ያልሆነ ቦታ ከፈለጉ መንገዱን በ 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=... ተልኳል።
textTypeወደ plain ነባሪዎች። የንብረት እሴቶችዎ እውነተኛ የኤችቲኤምኤል ቁርጥራጮችን ከያዙ ብቻ 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በጊዜያዊ የኤችቲቲፒ ምላሾች ላይ ከፍተኛው የድጋሚ ሙከራ ሙከራዎች (408, 425, 429, 500, 502, 503, 504)። ወደ 5 ነባሪዎች። ጠቅላላ የኤችቲቲፒ ጥሪዎች በአንድ ጥያቄ 1 + maxRetries ነው።
retryBackoffMsካፕ (ms) በማንኛውም ነጠላ የኋላ እንቅልፍ ላይ። ወደ 30000 ነባሪዎች። የ Azure Retry-After ራስጌ በሚገኝበት ጊዜ በትክክል ይከበራል; . አለበለዚያ የተደናገጠ ገላጭ ጀርባ ጥቅም ላይ ይውላል፣ በዚህ እሴት ተሸፍኗል።
protectPlaceholdersወደ true ነባሪዎች። ሲበራ እንደ {{name}}፣ ${var}፣ {0}፣ {0:N2}፣ %s፣ %1$s እና ኤችቲኤምኤል አካላት ያሉ ቶከኖች ከመተርጎማቸው በፊት በሴንቲነል ቶከኖች ይተካሉ እና ከዚያ በኋላ ይመለሳሉ። ምንጩ ሆን ብሎ የቦታ ያዥ ቅርጽ ያላቸውን ቃል በቃል ሲይዝ ብቻ አሰናክሏል።
customPlaceholderPatternsተጨማሪ የ regex ቅጦች (ያለ ገደቢዎች) ወደ ነባሪው የቦታ ያዥ ስብስብ ታክለዋል፣ ለምሳሌ <<.+?>> ለብጁ ማስመሰያ አገባብ። ልክ ያልሆኑ regexs ችላ ተብሏል።
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 እሴት ጥቅም ላይ ይውላል.
- የተዋሃዱ እሴቶች ተረጋግጠዋል። ልክ ያልሆኑ enums (ለምሳሌ
profanityAction: Mask) ድርጊቱ ግልጽ በሆነ መልእክት በፍጥነት እንዲሳካ ያደርጉታል።
ቃና እና ኢንዱስትሪ፣ በግልፅ አነጋገር
የ Azure AI ተርጓሚ v3 ኤፒአይ አንድም የቃና ቁልፍ የለውም። አብዛኛዎቹን ተመሳሳይ ቁጥጥር ለመስጠት ሁለት ቅንብሮች ይጣመራሉ -
- ኢንዱስትሪ / ጎራ በራስዎ ኮርፐስ የሰለጠነ የ Azure Custom Translator ምድብ ላይ ለመጠቆም
categoryIdይጠቀሙ - ህጋዊ፣ ቴክኒካል፣ ህክምና፣ ግብይት ወይም ሌላ ማንኛውም ነገር። ይህ ለድምፅ፣ ለብራንድ ድምጽ እና የቃላት ዝርዝር በጣም ጠንካራው ማንሻ ነው። - የ ገጽ ጽሁፍ የምርት ስሞችን እና የምርት ቃላትን በቃል ለመቆለፍ ትንሽ መዝገበ ቃላት ይጠቀሙ እና ለወጣት ታዳሚዎች አካባቢያዊነትን ሲያነጣጥሩ ጸያፍ ቃላትን ለማፅዳት
profanityActionይጠቀሙ።