Google Translate API Resources not working in Hindi

74 views
Skip to first unread message

young Zhang

unread,
Apr 1, 2021, 4:23:46 AM4/1/21
to Google Cloud Translation API
When I try to translate Hindi to English, there is something wrong:

Input parameters target=en&q=mujhe+coin+dene+ki+kripa+karoge

Return
{
"data": {
"translations": [
{
"translatedText": "mujhe coin dene ki kripa karoge",
"detectedSourceLanguage": "hi"
}
]
}
}

We can see the detectedSourceLanguage is "hi", but the translatedText is still hindi. Does anyone know why this is? Is it a bug of Google translate API?

Kevin Islas

unread,
Apr 4, 2021, 5:11:02 PM4/4/21
to Google Cloud Translation API
Hi, 

We don't currently support transliteration, so the API is able to detect that the query is a Hindi transliteration but doesn't translate it.
However,  you can get a translation by sending the request using the Hindi alphabet. For example:
{
  "q": ["नमस्ते दुनिया"],
  "target": "en"
}

Results in:
{
  "data": {
    "translations": [
      {
        "translatedText": "Hello world",
        "detectedSourceLanguage": "hi"
      }
    ]
  }
}

If you are interested in transliteration, you can submit a Feature Request.

Best,
Kevin

Reply all
Reply to author
Forward
0 new messages