ilyachch / md_docs-trans-app

Application for translation documentation in MD format
MIT License
49 stars 13 forks source link

Translation removes the italic formatting #66

Open nucleus-ffm opened 7 months ago

nucleus-ffm commented 7 months ago

Conditions:

Source file:

_Markdown Docs Translator ist ein automatischer Übersetzer für Markdown-Dokumente, der mit Python entwickelt wurde. Das Tool unterstützt mehrere Übersetzungsdienste und bietet eine Vielzahl von Optionen zur Anpassung des Übersetzungsprozesses._

Expected translation:

_Markdown Docs Translator is an automatic translator for Markdown documents developed with Python. The tool supports multiple translation services and offers a variety of options to customize the translation process._

Actual translation:

Markdown Docs Translator is an automatic translator for Markdown documents developed with Python. The tool supports multiple translation services and offers a variety of options to customize the translation process.

Additional context [Optional] It seems that the translation does not correctly preserve the formatting of italicized sentences. Individual words work without problems.

nucleus-ffm commented 1 month ago

is there an update on this issue?

ilyachch commented 3 weeks ago

Hi, @nucleus-ffm!

Sorry for such a long answer. I can confirm the problem. Also, as I found out, this is caused with deepl api. Web version translation saves italic marks, but api responses with cleared text (that is not obvious=()

Also, I think, the most obvious way to fix it (send different parts of Paragraph) is not the best - the translation can vary depending on context.

The second way is to do recursive translation inside-out - Find the most nested element, translate it, substitute in parent and so on. But will make translation process much more long and, potentially can cause money drainage if translation uses paid plan.

In my opinion, the best way - is to check if the container contains only one nested block and if so, translate inner block (with the same check also). Some kind of recursive search inside to find the most deep common container. Instead on previous option, this can save additional money (deepl api charges for symbols).

ilyachch commented 3 weeks ago

After thinking about it, I have a question: is it has to be fixed? Since it's a third-party service issue