How to upload an html file for translation

362 views
Skip to first unread message

nlg_development

unread,
Feb 14, 2019, 4:34:12 PM2/14/19
to Google Cloud Translation API
Hi,

I am using Google API and I want to send for translation an HTML file. Is that feasible?

The method TranslateHtml translates html items as a string. Is it possible to upload a file and send for translation via API?

Thank you in advance.

Kan Qiao

unread,
Feb 15, 2019, 12:12:54 PM2/15/19
to Google Cloud Translation API
Hi,
   You can inline html content in the Translation request, and set mime_type to be "text/html"

nlg_development

unread,
Feb 19, 2019, 9:00:02 AM2/19/19
to Google Cloud Translation API
Hi,

Thank you for your answer!


for the translating process via API there are two available actions TranslateText and TranslateHtml. Both of them are translating string and not files. So, the only way is to convert an html to string and send for translation as a text?

Thanks.

Yue Shi

unread,
Feb 19, 2019, 12:21:17 PM2/19/19
to Google Cloud Translation API
Hi,

Yes, converting to string is required.
Reply all
Reply to author
Forward
0 new messages