The Translation API allows you to translate text from one language to another. Below are the languages supported for the translation API and the formality, length control, and profanity masking parameters.

Supported languages

To specify a language for the translation API, use the ISO-639-1 language code. For example, en for English, zh for Chinese, fr for French, es for Spanish. If the language has a variant, the code appends the two-digit ISO-3166 country code. For example, Mexican Spanish is es-MX.

The Translation API supports the following languages:

LanguageLanguage code
Afrikaansaf
Albaniansq
Amharicam
Arabicar
Armenianhy
Azerbaijaniaz
Bengalibn
Bosnianbs
Bulgarianbg
Catalanca
Chinese (Simplified)zh
Chinese (Traditional)zh-TW
Croatianhr
Czechcs
Danishda
Darifa-AF
Dutchnl
Englishen
Estonianet
Farsi (Persian)fa
Filipino, Tagalogtl
Finnishfi
Frenchfr
French (Canada)fr-CA
Georgianka
Germande
Greekel
Gujaratigu
Haitian Creoleht
Hausaha
Hebrewhe
Hindihi
Hungarianhu
Icelandicis
Indonesianid
Irishga
Italianit
Japaneseja
Kannadakn
Kazakhkk
Koreanko
Latvianlv
Lithuanianlt
Macedonianmk
Malayms
Malayalamml
Maltesemt
Marathimr
Mongolianmn
Norwegian (Bokmål)no
Pashtops
Polishpl
Portuguese (Brazil)pt
Portuguese (Portugal)pt-PT
Punjabipa
Romanianro
Russianru
Serbiansr
Sinhalasi
Slovaksk
Sloveniansl
Somaliso
Spanishes
Spanish (Mexico)es-MX
Swahilisw
Swedishsv
Tamilta
Telugute
Thaith
Turkishtr
Ukrainianuk
Urduur
Uzbekuz
Vietnamesevi
Welshcy

Formality

Formal translations use language associated with formal, polite communication, such as formal forms of second person pronouns and their verb agreement. Informal translations use language associated with informal, casual communication, such as informal forms of second person pronouns and their verb agreement.

The following languages support formal and informal translations. Set the formality parameter to true to use a formal translation, and false to use an informal translation.

LanguageLanguage code
Dutchnl
Frenchfr
French (Canada)fr-CA
Germande
Hindihi
Italianit
Japaneseja
Koreanko
Portuguese (Portugal)pt-PT
Spanishes
Spanish (Mexico)es-MX

Length control

Sometimes, translated text is longer than the original source text. You can use length control to limit the length of the translated text. Set the length_control parameter to true to enable length control.

Length control is available for the following languages:

LanguageLanguage code
Frenchfr
Germande
Italianit
Portuguese (Brazil)pt
Spanishes

Profanity masking

You can choose to mask profanity in the translated text for all languages except the languages listed in the table below.

The following languages do not support profanity masking:

LanguageLanguage code
Bengalibn
Hindihi
Malayalamml
Punjabipa
Sinhalasi
Vietnamesevi

Was this page helpful?