i am trying to integrate Microsoft Translator API v3.0 for real time translation of HTML documents and i have an active API subscription .
There was a javascript based widget available for Microsoft Translator API but it was deprecated in favor of the API . Please see the answer provided in the below link Error on translating my web application . The translator API has support for translating HTML characters but it has a 5000 characters per request limit. Please see the link https://learn.microsoft.com/en-us/azure/cognitive-services/Translator/request-limits .
The HTML documents that need real time translation
- Have an average character count of more than 6000 per document
- Have a complex element structure.
I tried to split the HTML into 5000 character using jsoup , but the complexity is with identifying text within child elements and mapping the translated text back to HTML . so it seems technically it is not possible to split the HTML documents into 5K chunks .A close solution would be to integrate the API by developing a custom Javascript widget . The javascript widget for google translate is an ideal candidate as it translates on an ondemand basis ( the translated text is rendered as one scrolls through a web page ). However , it can not be reused since its code is tightly coupled with Google translator API.
Appreciate your help providing any pointers. Please note that batch translation is not an option as I am looking for real time translation solution