Skip to content

Language

Choose your language

Switch to the same page in another language.

English English en Afrikaans Afrikaans af አማርኛ Amharic am العربية Arabic ar অসমীয়া Assamese as Azərbaycan Azerbaijani az Башҡорт Bashkir ba Български Bulgarian bg भोजपुरी Bhojpuri bho বাংলা Bangla bn བོད་སྐད་ Tibetan bo बड़ो Bodo brx Bosanski Bosnian bs Català Catalan ca Čeština Czech cs Cymraeg Welsh cy Dansk Danish da Deutsch German de डोगरी Dogri doi Dolnoserbšćina Lower Sorbian dsb ދިވެހިބަސް Divehi dv Ελληνικά Greek el Español Spanish es Eesti Estonian et Euskara Basque eu فارسی Persian fa Suomi Finnish fi Filipino Filipino fil Vakaviti Fijian fj Føroyskt Faroese fo Français French fr Français (Canada) French (Canada) fr-CA Gaeilge Irish ga Galego Galician gl कोंकणी Konkani gom ગુજરાતી Gujarati gu Hausa Hausa ha עברית Hebrew he हिन्दी Hindi hi छत्तीसगढ़ी Chhattisgarhi hne Hrvatski Croatian hr Hornjoserbsce Upper Sorbian hsb Haitian Creole Haitian Creole ht Magyar Hungarian hu Հայերեն Armenian hy Indonesia Indonesian id Ìgbò Igbo ig Inuinnaqtun Inuinnaqtun ikt Íslenska Icelandic is Italiano Italian it ᐃᓄᒃᑎᑐᑦ Inuktitut iu Inuktitut (Latin) Inuktitut (Latin) iu-Latn 日本語 Japanese ja ქართული Georgian ka Қазақ Тілі Kazakh kk ខ្មែរ Khmer km Kurmancî Kurdish (Northern) kmr ಕನ್ನಡ Kannada kn 한국어 Korean ko كٲشُر Kashmiri ks کوردیی ناوەندی Kurdish (Central) ku Кыргызча Kyrgyz ky Lëtzebuergesch Luxembourgish lb Lingála Lingala ln ລາວ Lao lo Lietuvių Lithuanian lt Luganda Ganda lug Latviešu Latvian lv 中文 (文言文) Chinese (Literary) lzh मैथिली Maithili mai Malagasy Malagasy mg Te Reo Māori Māori mi Македонски Macedonian mk മലയാളം Malayalam ml Монгол хэл Mongolian (Cyrillic) mn-Cyrl ᠮᠣᠩᠭᠣᠯ ᠬᠡᠯᠡ Mongolian (Traditional) mn-Mong মৈতৈলোন Manipuri mni मराठी Marathi mr Melayu Malay ms Malti Maltese mt Hmong Daw Hmong Daw mww မြန်မာ Myanmar (Burmese) my Norsk Bokmål Norwegian Bokmål nb नेपाली Nepali ne Nederlands Dutch nl Sesotho sa Leboa Sesotho sa Leboa nso Chinyanja Chichewa nya ଓଡ଼ିଆ Odia or Hñähñu Querétaro Otomi otq ਪੰਜਾਬੀ Punjabi pa Polski Polish pl دری Dari prs پښتو Pashto ps Português (Brasil) Portuguese (Brazil) pt Português (Portugal) Portuguese (Portugal) pt-PT Română Romanian ro Русский Russian ru Ikirundi Rundi run Kinyarwanda Kinyarwanda rw سنڌي Sindhi sd සිංහල Sinhala si Slovenčina Slovak sk Slovenščina Slovenian sl Gagana Sāmoa Samoan sm chiShona Shona sn Soomaali Somali so Shqip Albanian sq Српски (ћирилица) Serbian (Cyrillic) sr-Cyrl Srpski (latinica) Serbian (Latin) sr-Latn Sesotho Sesotho st Svenska Swedish sv Kiswahili Swahili sw தமிழ் Tamil ta తెలుగు Telugu te ไทย Thai th ትግር Tigrinya ti Türkmen Dili Turkmen tk Lea fakatonga Tongan to Türkçe Turkish tr Татар Tatar tt Reo Tahiti Tahitian ty ئۇيغۇرچە Uyghur ug Українська Ukrainian uk اردو Urdu ur Uzbek (Latin) Uzbek (Latin) uz Tiếng Việt Vietnamese vi isiXhosa isiXhosa xh Èdè Yorùbá Yoruba yo Yucatec Maya Yucatec Maya yua 粵語 Cantonese (Traditional) yue 中文 (简体) Chinese Simplified zh-Hans 中文 (繁體) Chinese Traditional zh-Hant isiZulu isiZulu zu

Reference

Inputs & outputs

Every input is also accepted in the optional repo config file. When both are set, the action input wins.

On this page

    See Configuration for the YAML schema and loading order.

    Required inputs

    Required inputs
    NameDescription
    sourceLocale Source locale (e.g. en) used to find resource files such as **/*.en.resx. Also forwarded to Translator as from=<locale>.
    subscriptionKey Azure AI Translator subscription key. Pass via secrets.
    endpoint Translator endpoint URL, e.g. https://api.cognitive.microsofttranslator.com/.

    Common optional inputs

    Common optional inputs
    Name Default Description
    region none Translator resource region (omit for global resources).
    toLocales all supported Locales to translate to. Accepts a JSON array (["fr","de"]) or comma-separated values.
    include none Newline-separated glob patterns; only matching files are translated.
    exclude none Newline-separated glob patterns; matching files are skipped (applied after include).
    configPath .github/resource-translator.yml Path to the YAML config file (relative to the workspace root).
    dryRun false When true, run translations and emit summaries but do not write files.
    failOnError true When true, unexpected errors fail the action; when false, errors are warnings.

    Translator request inputs

    These map directly onto Azure AI Translator v3 query parameters. Every one is optional; the Translator defaults apply when unset.

    Translator request inputs
    Name Default Description
    categoryId general Azure Custom Translator category — the industry/domain/tone knob. Forwarded as ?category=....
    textType plain plain or html. Use html only when your resource values are real HTML fragments.
    profanityAction NoAction NoAction, Marked, or Deleted. Controls how profane terms are emitted in translations.
    profanityMarker Asterisk Asterisk or Tag. Only meaningful when profanityAction is Marked.
    allowFallback true (Translator default) When false, Translator returns an error instead of falling back to the general system if your categoryId has no deployment for a target locale.
    apiVersion 3.0 Translator REST API version.

    Resilience & placeholder protection

    These inputs control how the action behaves when Translator throttles your request and how it shields placeholder tokens like {{name}} or {0} from being mangled during translation.

    Resilience and placeholder protection inputs
    Name Default Description
    maxRetries 5 Maximum retry attempts on transient HTTP responses (408, 425, 429, 500, 502, 503, 504). The total number of HTTP calls per request is 1 + maxRetries.
    retryBackoffMs 30000 Cap (in milliseconds) on any single backoff sleep. The action honors Azure's Retry-After response header exactly when present; otherwise it uses jittered exponential backoff capped at this value.
    protectPlaceholders true When true (default), placeholders such as {{name}}, ${var}, {0}, {0:N2}, %s, %1$s and HTML entities are replaced with sentinel tokens before translation and restored afterward. Disable only when your source intentionally contains literal placeholder-shaped text that should be translated.
    customPlaceholderPatterns none Newline-separated regexes (without delimiters) added to the default placeholder set, e.g. <<.+?>> for custom token syntax.
    noTranslatePatterns none Newline-separated glob patterns matched against parser-level keys (JSON dotted path, RESX name, PO msgid, XLIFF unit id, INI/restext key). Matching keys are dropped from the Translator request and pass through with their source value preserved.

    Outputs

    Outputs
    NameDescription
    summary-title Short PR-title-friendly summary, e.g. Machine-translated 320 files, a total of 5,418 translations.
    summary-details Markdown summary suitable for a PR body or job summary.
    has-new-translations 'true' when one or more new translations were generated.