HTML code gets corrupted in language translation files

hello, lassoan,

I have completed the translation of the strings for Japanese.
But, I found that some HTML tags disappear after saving the translation.
Some strings including HTML tags, and the tags and parameter values in tags disappear, in particular,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">

is changed to


&lt;html&gt;<meta name="qrichtext" content="1"><style type="text/css">

Also, some style strings are changed, like

</span><span style=" font-size:8pt; font-weight:600;">

to

</span><span style="">

If you have a solution for this, please let me know.
Thanks.

I agree. The same is true for Korean.

In my opinion, it seems to occur only for characters using a 2-byte character set.

Also, in the case of Korean, 100% translation was performed on Weblate, but translation was not applied in some surrenders.

We enabled in Weblate to have HTML code in translation files, so text corruption should not occur anymore. The existing messages should be fixed up as explained in HTML tags and special characters get corrupted · Issue #14 · Slicer/SlicerLanguagePacks · GitHub.

Going forward, we’ll try to avoid using HTML formatting in translatable text, by adding formatting outside the translatable strings wherever it is possible.

Thanks, Lassoan

I checked the Japanese translation on Weblate. I have done the replacement of the < > and so on to the original charactors and copying the html tags which are included in the origianl English strings to the translated strings.

Aki

1 Like