<ISO 639-3>_<Script> format: an ISO 639-3 language code, an underscore and an ISO 15924 script code, for example eng_Latn, arb_Arab, zho_Hans (Simplified Chinese) and zho_Hant (Traditional Chinese).
This format applies to translation only. Speech-to-Text and Text-to-Speech keep using locales such as
en-US.Accepted input
Language fields in requests also accept ISO 639-1 (en), ISO 639-3 (eng) and BCP 47 (zh-Hans, pt-BR) codes. Matching ignores letter case, and - and _ are interchangeable. A region may select the script, so zh-TW becomes zho_Hant, and a few codes resolve to a specific language, so ar becomes arb_Arab.
To detect the source language automatically, omit source_language or set it to an empty string or auto.
A language the selected model does not support is rejected. Get Model Details returns each model’s supported languages: translate_capability.target_languages for text translation models and languages for real-time translation models.
Responses
Languages determined by the service, such as detected languages and model language lists, use the
<ISO 639-3>_<Script> format.
In real-time translation, the ready message and translation.target_language echo the languages you sent in init, while transcript.language and translation.source_language contain the detected language as a code. To compare the two, send your languages in the <ISO 639-3>_<Script> format.
