Opened 3 years ago

Closed 3 years ago

#1137 closed defect (fixed)

Translation of programming languages may break preferences in the same language

Reported by: claudio Owned by:
Priority: major Milestone:
Component: editor Version: trunk
Keywords: "translation bug" Cc:

Description

The highlighter mime value (programming language name) is retrieved from a *translated* Wx-widget. Because you normally don't translate names of Programming languages, or rather: you "translate" the strings by copy-pasting (and get 100% coverage), this causes no problems most of the time.

In this particular case "Perl 5" was translated as "Perl 5 " (with an extra space). Because this strings is used to look up the mime type and later select the string, an unused values slips in Padre breaking the Lexer selection in preferences for the specific language.

Could not find the MIME type of the display name 'Perl 5 '
Use of uninitialized value $name in string eq at /home/claudio/Code/Padre/trunk/Padre/lib/Padre/MimeTypes.pm line 487.
Use of uninitialized value $name in string eq at /home/claudio/Code/Padre/trunk/Padre/lib/Padre/MimeTypes.pm line 487.
Use of uninitialized value $name in string eq at /home/claudio/Code/Padre/trunk/Padre/lib/Padre/MimeTypes.pm line 487.
Use of uninitialized value $name in concatenation (.) or string at /home/claudio/Code/Padre/trunk/Padre/lib/Padre/MimeTypes.pm line 489.
Could not find highlighter for

Change History (1)

comment:1 Changed 3 years ago by claudio

  • Resolution set to fixed
  • Status changed from new to closed

In this case (r13778), the bug is resolved without any disadvantages. The solution is making the name of Programming languages non-translatable. Before the fix the strings were marked as translatable and, as a consequence, part of the po files. Nevertheless, *any* changes to the string would result in a bug in Padre only for that specific language.

Users knowledgeable of non Western languages (or native speakers) should check if the "international" programming language names are acceptable. If not, we need to change the way mime types are stored in Padre.

Note: See TracTickets for help on using tickets.