translate-tools/linguist

Enhancement Request: Block-Level HTML Translation

Aberta

#375 aberto em 29 de jun. de 2023

 (3 comentários) (2 reações) (0 responsável)TypeScript (50 forks)auto 404
RFCenhancementhelp wantedimportant

Métricas do repositório

Stars
 (1.033 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Hello esteemed developers,

First of all, I'd like to express my sincere gratitude for your hard work in maintaining and improving this great project. Your dedication is invaluable to the entire community.

Recently, I've encountered an issue regarding the translation of Japanese language within HTML content. As you might know, the syntax and structure of Japanese significantly differ from English. This leads to inaccurate and often nonsensical translations when translation is done at the inline HTML element level.

To illustrate, let's consider the following example:

<p>She is <em>looking forward</em> to your visit.</p>

Translated results are as follows:

<p>彼女は<em>楽しみ</em>ご来場ありがとうございました。</p>

Retranslate back to English and it will look like this:

<p>She <em>enjoyed</em> the show, thank you for coming.</p>

Translating this on an element-by-element basis would not yield the intended meaning in Japanese.

Therefore, I propose a feature enhancement where translation happens at the block HTML element level, instead of at the inline level, especially when dealing with languages like Japanese.

For example, the translation feature could be enhanced to behave as follows:

<div>彼女はあなたの訪問を<em>心待ちに</em>している。</div>

Retranslate back to English and it will look like this:

<div>She is <em>looking forward</em> to your visit.</div>

The entire div block is translated as a single unit, which will lead to a more accurate translation.

Google Translate and DeepL translations support the translation of strings containing HTML.

It would be very nice to see features such as inline elements translating at the same time as block elements implemented in the options settings.

I hope this suggestion is taken into consideration and am looking forward to seeing how this project continues to evolve.

Thank you again for your efforts and dedication.

Best regards.

Guia do colaborador