Opened 9 years ago

Closed 6 years ago

#7491 closed enhancement (fixed)

AboutSystem: clicking on localized license name doesn't open license file

Reported by: taos Owned by: nielx
Priority: normal Milestone: R1
Component: Applications/AboutSystem Version: R1/Development
Keywords: localization Cc: adam.s.hartford@…
Blocked By: Blocking:
Platform: All


Using hrev41319 (gcc2hybrid).

Normally, when clicking on a license name in AboutSystem the corresponding license file is opened - e.g. clicking on "BSD (3-clause)" opens /boot/system/data/licenses/BSD (3-clause) in StyledEdit.

When working with a localized system, a number of license names are translated (BSD (x-clause), MIT (no promotion), etc). Now, AboutSystem still looks for the corresponding (translated) license files but - of course - can't find a match in the license directories because the file names are not localized. A french system would search for "BSD (3-clauses)", a german system for "3-Klausel-BSD" instead of "BSD (3-clause)".

Not localizing the license strings might be an easy workaround. However, it would be nicer if AboutSystem could - as fall-back in case there is no localized file - just open the corresponding not-localized license file.

Attachments (2)

ticket_7491.patch (4.8 KB ) - added by ahartford 8 years ago.
Patch to localize license names only, not URLs.
0001-AboutSystem-Only-translate-hyperlink-text.-Fixes-749.patch (15.2 KB ) - added by jessicah 6 years ago.

Download all attachments as: .zip

Change History (11)

by ahartford, 8 years ago

Attachment: ticket_7491.patch added

Patch to localize license names only, not URLs.

comment:1 by ahartford, 8 years ago

patch: 01

comment:2 by ahartford, 8 years ago

Cc: adam.s.hartford@… added

comment:3 by nielx, 8 years ago

Owner: changed from nobody to nielx
Status: newin-progress

I will review this patch.

comment:4 by pulkomandy, 8 years ago

patch: 10

comment:5 by pulkomandy, 8 years ago

the patch as it is there will break collecting catkeys. You need to use B_TRANSLATE_NOCOLLECT on the fist one, and use B_TRANSLATE_MARK (or whatever it is called this days) for the licence strings. There should be one macro which marks the string for collecting, but returns it as-is for compilation of the program. Check the headers to make sure.

comment:6 by jessicah, 6 years ago

patch: 01

comment:7 by jessicah, 6 years ago

I'm not sure if should mark all instances in .SetLicense for translating or not... if it's acceptable as is, I'll push to repo.

comment:8 by pulkomandy, 6 years ago

Yes, I thought so while reviewing the patch. It's safe to not mark all licenses, as B_TRANSLATE will default to english when no translations are found.

I think adding all the licenses to the translation is just cluttering the catalog files, wasting space and annoying the people doing the translations. So, I think we should instead:

  • Mark only the licences where there is something to translate ("MIT (no promotion)", but not "MIT").
  • Mark only the first occurence of each license. Maybe move them to constants instead of repeating the strings.

comment:9 by jessicah, 6 years ago

Resolution: fixed
Status: in-progressclosed

Fixed in hrev47199

Note: See TracTickets for help on using tickets.