Sorry, we don't support your browser.  Install a modern browser

API POST /translate that accepts HTML (in addition to JSON)#106

This is the same functionality as is currently provided by the JS Widget, however, it would take a block of HTML passed to the API in one language and return it as HTML (or HTML in JSON) in one or more different languages.

There are several use cases for this.

Primary: Translate transactional emails to deliver them in the preferred language of the user. We have MANY transactional emails where the content is being optimized and refined on a regular basis. Some of our users use our application in languages besides english and we would like to deliver emails to them in their preferred language.

To do this, we would generate their transactional email content (HTML), then if they have a language preference that is not the primary language we would convert the HTML content of the email to the target language using the Weglot API before sending.

3 years ago

I see, indeed for now you have to “split” it before sending to Weglot if you are using our API directly. This is what WordPress plugin and Shopify and JS library already do. We won’t allow full HTML block for the API as we want to avoid unecessary tags. For example, if you give a full HTML page to the API, it’s useless because many content on the page doesn’t need to be translated. Like script tag or css tags etc…

3 years ago