详见 配置 YAML 模式及载入顺序。
所需输入
sourceLocale源地(如en)用以尋資源檔,如**/*.en.resx。 亦转发于from=<locale>。
提供者選擇與資格
每次provider择一医者。 仅供所选供应商之凭证,详见 输入与输出 指南以备全设。
provider译者:azure(默认)、aws、google。 每次行動呼叫僅用一供應者。
subscriptionKeyAzure AI Translator 订阅密钥。 azure必备。 由secrets通行。
endpointAzure Translator 端點網址,如 https://api.cognitive.microsofttranslator.com/。 azure必备。
awsAccessKeyIdAWS访问密钥ID。 可选者,awsSecretAccessKey省略AWS默认凭证链/OIDC。 由secrets通行。
awsSecretAccessKeyAWS秘密访问密钥。 必與 awsAccessKeyId 一同供應。 由secrets通行。
awsSessionToken可选AWS会话令牌以暂时凭证。 由secrets通行。
awsRegionAWS區域為翻譯服務(如us-east-1)。 除非AWS_REGION設於環境中,否則aws必備。
awsFormalityAWS Translate formality setting: FORMAL or INFORMAL.
awsBrevityWhen true, enables AWS Translate brevity mode for supported language pairs.
awsTerminologyNamesAWS Translate custom terminology resource names. Accepts a JSON array or comma-separated values.
awsParallelDataNamesAWS Translate parallel data resource names. Accepts a JSON array or comma-separated values.
googleApiKey谷歌云API密钥。 请提供此手术室googleCredentials以供google。 由secrets通行。
googleCredentials谷歌云服务账户密钥为JSON字符串。 请提供此手术室googleApiKey以供google。 由secrets通行。
googleProjectId可选谷歌云项目编号。 常由服务账户凭证推断。
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.
常见可选输入
region译者资源区(全局资源省略)。
toLocales可译之地。 接受JSON陣列(["fr","de"])或逗號分隔值。
include新行分離球狀; 仅译相符文件。
exclude新行分離球狀; 相符文件跳过(含后应用)。
configPath通往YAML配置檔之路徑(相對於工作區根節點)。
changeDetectionSmart change detection mode. smart translates only keys whose source value, target presence, state entry, or translation-affecting settings require it. Use disabled or false to send every eligible key on every run.
statePathPath to the compact deterministic smart change-detection state manifest. Defaults to .github/resource-translator-state.json; commit it so future runs can audit and reuse unchanged translations.
snapshotOnlyWhen true, create/update the smart change-detection manifest from existing source and target files without calling a translation provider or writing target resource files. Useful when bootstrapping statePath while a provider is unavailable.
dryRuntrue时,运行翻译并发出摘要,然不写文件。
failOnError若true,則意外錯誤失敗; false时,错误即警告。
Azure Translator request inputs
此等参数直映于Azure AI Translator v3查询参数,适用于Azure供应者。 textType与profanityAction亦映射至AWS/Google,彼处有对应者(详见提供者指南); 餘者僅屬Azure。 皆可選; 譯者預設不變時適用。
categoryIdAzure Custom Translator category — the industry/domain/tone knob. 转发为?category=...。
textTypeplain或html。 唯资源值为真实HTML片段时方用html。
profanityActionNoAction、Marked或Deleted。 控制译文中粗俗词汇之发出。
profanityMarkerAsterisk或Tag。 唯profanityAction Marked方有意义。
allowFallback若false,若categoryId无目标部署,译者则返错,非回归通用系统。
apiVersion譯者REST API版本。
韌性與佔位符保護
此等输入控动作于译者限速时之行为,及如何护持占位符如{{name}}、{0}不致翻译时受损。
maxRetries瞬态HTTP响应之最大重试次数(408, 425, 429, 500, 502, 503, 504)。 每请求之HTTP调用总数为1 + maxRetries。
retryBackoffMs于任何单次后退睡眠中,电容(毫秒计)。 此動作於Azure之Retry-After回應首部存在時,精確遵守; 否则则用抖动指数退避,限于此值。
protectPlaceholderstrue(默认)时,{{name}}、${var}、{0}、{0:N2}、%s、%1$s及HTML实体等占位符,译前皆以哨兵标记代之,译后复原。 惟当源意含字面占位文字,宜译时禁用之。
customPlaceholderPatterns加行分隔正则表达式(无分隔符)入默认占位符集,如<<.+?>>用于自定义令牌语法。
noTranslatePatterns新行分離之球狀,與解析器層級鍵(JSON虛線路徑、RESX name、PO msgid、XLIFF單元id、INI/重文本鍵)相匹配。 匹配密鑰自譯者請求中剔除,並保留其源值通過。
输出
summary-title简短且适合公关标题之摘要,如《Machine-translated 320 files, a total of 5,418 translations》。
summary-detailsMarkdown摘要适于公关机构或职位摘要。
has-new-translations'true'新译本一或多者生成。