How to translate HTML from English to Japanese without adding "です" to tags in Azure Translate

FABIO ANDRES BAZURTO BLACIO 25 Reputation points
2023-12-01T19:23:34.49+00:00

I'm using Azure Translate to convert HTML strings from English to Japanese. Here's an example of my input:

<html><body><p>Hello my friends </p></body></html>

And the output with Japanese characters inserted in tags:

<html><body><p>こんにちは、</p></body></htmlです>

I want to configure my Translation Resource so that the output doesn't contain the extra character "です". What do I need to do to achieve this?

Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
363 questions
0 comments No comments
{count} votes

Accepted answer
  1. romungi-MSFT 43,656 Reputation points Microsoft Employee
    2023-12-04T07:17:28.7933333+00:00

    @FABIO ANDRES BAZURTO BLACIO How is the exact request passed in your case? I have tried the above sentence with textType=HTML and it seems to translate correctly. Please see the screen shot below.

    User's image

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2023-12-01T19:23:34.4933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Azure Translate adds "です" to the end of the translated text because it is using polite form (です・ます) by default. To remove "です" from the translated HTML, you can change the style to plain form (だ・である) in the Translation Resource configuration. This can be done by setting the "textType" parameter to "plain" in the request body. Here's an example of what the request body would look like:

    {
        "apiVersion": "3.0",
        "from": "en",
        "to": "ja",
        "textType": "plain",
        "text": "<html><body><p>Hello my friends </p></body></html>"
    }
    

    This will result in the following output:

    <html><body><p>こんにちは、</p></body></html>
    

    Note that this will change the style of the entire text, not just the tags. If you need more fine-grained control over the translation, you may need to use a different translation tool or manually edit the output.


    References:

    0 comments No comments