Does Google Cloud Translation API support language like "en-US"?

29 views Asked by At

The language support document says it supports en.

However, it is possible to call api by specifying "en-US" for target language as follows.

curl -X POST -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" -H "Content-Type: application/json; charset=utf-8" -H "x-goog-user-project: <project id>" -d '{"contents": ["ふわっとオム焼きそば"], "sourceLanguageCode": "ja", "targetLanguageCode": "en-US"}' "https://translation.googleapis.com/v3/projects/<project id>:translateText"

Is the return value en or en-US?
Is the result the same whether en or en-us is specified?
The same can be said for KO and KO-KR.

0

There are 0 answers