ਜੇ ਤੁਹਾਨੂੰ ਗੈਰ-ਡਿਫੌਲਟ ਟਿਕਾਣੇ ਦੀ ਲੋੜ ਹੈ ਤਾਂ 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).
categoryIdਅਜ਼ੂਰ Custom Translator ਸ਼੍ਰੇਣੀ - ਤੁਹਾਡਾ ਉਦਯੋਗ / ਡੋਮੇਨ ਨੌਬ (ਕਾਨੂੰਨੀ, ਮੈਡੀਕਲ, ਮਾਰਕੀਟਿੰਗ ਟੋਨ, ਆਦਿ). ?category=... ਦੇ ਤੌਰ ਤੇ ਭੇਜਿਆ ਗਿਆ.
textTypeplain ਕਰਨ ਲਈ ਡਿਫਾਲਟ. html ਦੀ ਵਰਤੋਂ ਕੇਵਲ ਤਾਂ ਹੀ ਕਰੋ ਜੇ ਤੁਹਾਡੇ ਸਰੋਤ ਮੁੱਲਾਂ ਵਿੱਚ ਅਸਲ HTML ਟੁਕੜੇ ਹੁੰਦੇ ਹਨ।
profanityActionਅਨੁਵਾਦਿਤ ਆਉਟਪੁੱਟ ਵਿੱਚ ਅਸ਼ਲੀਲ ਸ਼ਬਦਾਂ ਨਾਲ ਕਿਵੇਂ ਵਿਵਹਾਰ ਕਰਨਾ ਹੈ.
profanityMarkerਸਿਰਫ ਉਦੋਂ ਹੀ ਅਰਥਪੂਰਨ ਹੁੰਦਾ ਹੈ ਜਦੋਂ profanityAction "Marked" ਹੁੰਦਾ ਹੈ.
allowFallbackਅਨੁਵਾਦ ਨੂੰ ਅਸਫਲ ਕਰਨ ਲਈ false 'ਤੇ ਸੈੱਟ ਕਰੋ ਜਦੋਂ ਤੁਹਾਡੇ categoryId ਕੋਲ ਆਮ ਮਾਡਲ 'ਤੇ ਵਾਪਸ ਆਉਣ ਦੀ ਬਜਾਏ ਟਾਰਗੇਟ ਲੋਕਲ ਲਈ ਕੋਈ ਤਾਇਨਾਤੀ ਨਹੀਂ ਹੈ।
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 ਸਿਰਲੇਖ ਨੂੰ ਬਿਲਕੁਲ ਸਨਮਾਨਿਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ ਜਦੋਂ ਮੌਜੂਦ ਹੁੰਦਾ ਹੈ; ਨਹੀਂ ਤਾਂ ਇਸ ਮੁੱਲ 'ਤੇ ਕੈਪਡ ਐਕਸਪੋਨੈਂਸ਼ੀਅਲ ਬੈਕਆਫ ਦੀ ਵਰਤੋਂ ਕੀਤੀ ਜਾਂਦੀ ਹੈ.
protectPlaceholderstrue ਕਰਨ ਲਈ ਡਿਫਾਲਟ. ਚਾਲੂ ਹੋਣ 'ਤੇ, {{name}}, ${var}, {0}, {0:N2}, %s, %1$s ਅਤੇ HTML ਇਕਾਈਆਂ ਵਰਗੇ ਟੋਕਨ ਨੂੰ ਅਨੁਵਾਦ ਤੋਂ ਪਹਿਲਾਂ ਸੈਂਟੀਨਲ ਟੋਕਨ ਨਾਲ ਬਦਲਿਆ ਜਾਂਦਾ ਹੈ ਅਤੇ ਬਾਅਦ ਵਿੱਚ ਬਹਾਲ ਕੀਤਾ ਜਾਂਦਾ ਹੈ. ਕੇਵਲ ਤਾਂ ਹੀ ਅਯੋਗ ਕਰੋ ਜਦੋਂ ਸਰੋਤ ਜਾਣਬੁੱਝ ਕੇ ਪਲੇਸਹੋਲਡਰ ਦੇ ਆਕਾਰ ਦੇ ਸ਼ਾਬਦਿਕ ਹੁੰਦੇ ਹਨ।
customPlaceholderPatternsਡਿਫੌਲਟ ਪਲੇਸਹੋਲਡਰ ਸੈੱਟ ਵਿੱਚ ਵਾਧੂ ਰੀਜੈਕਸ ਪੈਟਰਨ (ਡਿਲਿਮਿਟਰਾਂ ਤੋਂ ਬਿਨਾਂ) ਜੋੜੇ ਗਏ ਹਨ, ਉਦਾਹਰਨ ਲਈ ਕਸਟਮ ਟੋਕਨ ਸਿੰਟੈਕਸ ਲਈ <<.+?>>. ਅਵੈਧ ਰੈਜੈਕਸ ਨੂੰ ਨਜ਼ਰਅੰਦਾਜ਼ ਕੀਤਾ ਜਾਂਦਾ ਹੈ।
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.
ਲੋਡ ਕਰਨ ਦਾ ਆਰਡਰ
- ਐਕਸ਼ਨ ਵਰਕਫਲੋ ਤੋਂ ਸਪੱਸ਼ਟ ਇਨਪੁੱਟ ਪੜ੍ਹਦੀ ਹੈ।
- ਇਹ
configPathਤੋਂ YAML ਕੌਂਫਿਗ ਨੂੰ ਲੋਡ ਕਰਦਾ ਹੈ. - ਹਰ ਸਾਂਝੇ ਖੇਤਰ ਲਈ, ਇਨਪੁੱਟ ਜਿੱਤਦਾ ਹੈ; ਨਹੀਂ ਤਾਂ YAML ਮੁੱਲ ਦੀ ਵਰਤੋਂ ਕੀਤੀ ਜਾਂਦੀ ਹੈ.
- ਮਰਜ ਕੀਤੇ ਮੁੱਲਾਂ ਨੂੰ ਪ੍ਰਮਾਣਿਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ। ਅਵੈਧ ਈਨਮ (ਉਦਾਹਰਨ ਲਈ
profanityAction: Mask) ਇੱਕ ਸਪੱਸ਼ਟ ਸੁਨੇਹੇ ਨਾਲ ਕਾਰਵਾਈ ਨੂੰ ਤੇਜ਼ੀ ਨਾਲ ਅਸਫਲ ਕਰਨ ਦਾ ਕਾਰਨ ਬਣਦੇ ਹਨ।
ਸੁਰ ਅਤੇ ਉਦਯੋਗ, ਸਾਦੇ ਸ਼ਬਦਾਂ ਵਿੱਚ
Azure AI Translator v3 API ਵਿੱਚ ਇੱਕ ਸਿੰਗਲ ਟੋਨ ਨੌਬ ਨਹੀਂ ਹੈ। ਦੋ ਸੈਟਿੰਗਾਂ ਤੁਹਾਨੂੰ ਇਕੋ ਜਿਹਾ ਨਿਯੰਤਰਣ ਦੇਣ ਲਈ ਜੋੜਦੀਆਂ ਹਨ:
- ਉਦਯੋਗ / ਡੋਮੇਨ: ਆਪਣੇ ਖੁਦ ਦੇ ਕਾਰਪਸ 'ਤੇ ਸਿਖਲਾਈ ਪ੍ਰਾਪਤ ਅਜ਼ੂਰ Custom Translator ਸ਼੍ਰੇਣੀ ਵੱਲ ਇਸ਼ਾਰਾ ਕਰਨ ਲਈ
categoryIdਦੀ ਵਰਤੋਂ ਕਰੋ - ਕਾਨੂੰਨੀ, ਤਕਨੀਕੀ, ਮੈਡੀਕਲ, ਮਾਰਕੀਟਿੰਗ, ਜਾਂ ਕੁਝ ਹੋਰ. ਇਹ ਸੁਰ, ਬ੍ਰਾਂਡ ਆਵਾਜ਼ ਅਤੇ ਸ਼ਬਦਾਵਲੀ ਲਈ ਸਭ ਤੋਂ ਮਜ਼ਬੂਤ ਲੀਵਰ ਹੈ. - ਸਤਹ ਟੈਕਸਟ: ਬ੍ਰਾਂਡ ਦੇ ਨਾਮ ਅਤੇ ਉਤਪਾਦ ਦੀਆਂ ਸ਼ਰਤਾਂ ਨੂੰ ਸ਼ਬਦਾਵਲੀ ਲਾਕ ਕਰਨ ਲਈ ਸ਼ਬਦਾਵਲੀ ਦੀ ਵਰਤੋਂ ਕਰੋ, ਅਤੇ ਨੌਜਵਾਨ ਦਰਸ਼ਕਾਂ ਲਈ ਸਥਾਨਕਕਰਨ ਨੂੰ ਨਿਸ਼ਾਨਾ ਬਣਾਉਂਦੇ ਸਮੇਂ ਅਸ਼ਲੀਲ ਸ਼ਬਦਾਂ ਨੂੰ ਰਗੜਨ ਲਈ
profanityActionਦੀ ਵਰਤੋਂ ਕਰੋ.