Opened 8 years ago

Closed 5 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:
Has a Patch: yes 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 7 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 5 years ago.

Download all attachments as: .zip

Change History (11)

Changed 7 years ago by ahartford

Attachment: ticket_7491.patch added

Patch to localize license names only, not URLs.

comment:1 Changed 7 years ago by ahartford

Has a Patch: set

comment:2 Changed 7 years ago by ahartford

Cc: adam.s.hartford@… added

comment:3 Changed 7 years ago by nielx

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

I will review this patch.

comment:4 Changed 7 years ago by pulkomandy

Has a Patch: unset

comment:5 Changed 7 years ago by pulkomandy

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 Changed 5 years ago by jessicah

Has a Patch: set

comment:7 Changed 5 years ago by jessicah

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 Changed 5 years ago by pulkomandy

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 Changed 5 years ago by jessicah

Resolution: fixed
Status: in-progressclosed

Fixed in hrev47199

Note: See TracTickets for help on using tickets.