HTML text is untranslated

Bug #1818998 reported by Marco Ciampa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Expired
Low

Bug Description

In the KiCad Calculator for rf attenuators there is a formula untranslated (and untranslatable).
That text should be translatable...

Revision history for this message
Seth Hillbrand (sethh) wrote :

Hmm... This is full HTML. It should be feasible either by changing the compile setting to built-in or working with the gettext macros. I think the first option will be easier.

Changed in kicad:
importance: Undecided → Low
status: New → Triaged
tags: added: starter
Changed in kicad:
milestone: none → 5.1.1
milestone: 5.1.1 → 6.0.0-rc1
tags: added: pcb-calculator
Jakub Kozdon (fldrivers)
Changed in kicad:
assignee: nobody → Jakub Kozdon (fldrivers)
status: Triaged → In Progress
Revision history for this message
Jakub Kozdon (fldrivers) wrote :

The first proposal. It is a question if it is good idea to make formulas translatable.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Hi Jackub,

I am not especially thrilled by translating html texts.

The main reason is the fact initial sentences are barely understandable, due to both numerous <> sequences, and the fact many letters are &#... sequences.
For example:
"<b>Z<sub>in</sub></b> desired input impedance in &#8486;"
is not understandable.
And there are a lot (perhaps all) other examples in you patch.

Moreover, because the initial text is not really understandable, the risk to create bad html translations is high.

In fact only ASCII7 sentences can be easily translated.

Revision history for this message
Jakub Kozdon (fldrivers) wrote :

Hi,

I got inspired by tracks_width_versus_current.cpp. But as we are using wxHtmlWindow class then I think that it will be beneficial to use its capabilities. My proposal is to make translatable only parts "desired input impedance" so it will be rewritten for instance as "<b>Z<sub>in</sub></b> [&#8486;] desired input impedance".

Should I create new patch or patch which will be applied after my first?

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Hi Jackub,

As I wrote, I am *really* not especially thrilled by translating html texts.
This is never easy.

In this case (translating formulas) the benefit is low.

I don't know a good way to do that.
Tools used to translate strings are expecting ASCII7 *understandable* strings.
Html strings are never easy to translate.

Moreover, making only a substring translatable inside a string is a bad idea:
The order of words (and the words themselves) inside a full sentence depends on languages.
Therefore, breaking a sentence into translatable substrings is a bad idea.

Sorry to be rude, but I am really not thrilled by your patch about formula translations.
Nevertheless, thanks for your work.

Revision history for this message
Jakub Kozdon (fldrivers) wrote :

Another way is to use simple "Zin desired input impedance in ohms". This will not look nice as it can, but it will work. Or if it is possible, then some placeholders can be used.

Revision history for this message
Jakub Kozdon (fldrivers) wrote :

Another approach which exposes only strings which should be translated.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Using html in translatable help files is not the way to go.

Pcb calculator uses now help files in markdown format.
(They are converted on the fly in html to display them in dialogs)

These files are much more easy to create and to translate.

Revision history for this message
Jakub Kozdon (fldrivers) wrote :

Can you please give me a hint where I can see some example? I found only one in tracks_width_versus_current.cpp from line 444 and it is very similar as my solution.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Download latest sources.
Pcb_calculator/attenuators contains *.md help files, coming from their old .html version.
And the result (in corresponding .h files) is easy to translate.

Again, trying to translate *.html files is just a wasted time:
- because they a not easy to translate
- because help files *must be* maintainable.

Therefore maintainability excludes html sources like this:
<< "<i>L = 10<sup> a/10</sup> (" << _("the loss") << ")</i><br>"
<< "<i>A = (L + 1)/(L &minus; 1)</i><hr>"
<< "<b>" << _("Pi attenuator") << "</b><br>"
<< "<i>R2 = (L &minus; 1)/2 * &radic;((Z<sub>in</sub> * Z<sub>out</sub>)/L)</i><br>"

Maintaining such code is just not possible.
Noboby want to write html sources like this.
Moreover, to see what the html page is displayed, we have to recompile Kicad.
(FYI, the .md files are edited using a markdown editor to immediately see the result)

Therefore I *do not want* to use this kind of code in Kicad.

Sorry.

Revision history for this message
Jakub Kozdon (fldrivers) wrote :

Understand. So issue can be closed now, or there is something left?

Revision history for this message
jean-pierre charras (jp-charras) wrote :

For Pcb calculator, the issue can be closed.

However there is still a non translated help in html format
(eeschema/dialogs/dialog_bom_help.html)

If you volunteer, making a markdown of version of this help file could be good:
I could replace the html help by its markdown version (translatable)

thanks.

summary: - RF-Attenuators calculator formula is untranslated
+ HTML text is untranslated
tags: added: eeschema
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1875

Changed in kicad:
status: In Progress → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.