Opened 13 years ago

Closed 9 years ago

#7874 closed enhancement (fixed)

Localization of Decorators

Reported by: humdinger Owned by: czeidler
Priority: normal Milestone: R1
Component: Add-Ons/Decorators Version: R1/Development
Keywords: localization Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev42466.

The About window in the decorators tab of the Appearance prefs lacks localization. The relevant file DecorInfo.cpp being in the interface kit, this isn't just putting some B_TRANSLATE macro around strings. I looked at how Dragger.cpp does it and mimicked the method seen there.

As I'm not too sure what I'm doing, I'll attach a patch...
Actually two patches:
Decorator_aesthetics.diff is a modified decorator about window and renaming of "Window Decorator" to simple "Decorator" (plus a fixed typo which was why I looked at the thing in the first place...)
DecorInfo.diff is the localization stuff I'm not sure about.

While this would take care of the default decorator localization, the add-ons (SAT, MAC, WIN) use resource files for their about-info. Those aren't fit for translation, right?

Attachments (2)

Decorator_aesthetics.diff (2.0 KB ) - added by humdinger 13 years ago.
Aesthetical changes
DecorInfo.diff (2.6 KB ) - added by humdinger 13 years ago.
Localization

Download all attachments as: .zip

Change History (6)

by humdinger, 13 years ago

Attachment: Decorator_aesthetics.diff added

Aesthetical changes

comment:1 by humdinger, 13 years ago

patch: 01

by humdinger, 13 years ago

Attachment: DecorInfo.diff added

Localization

comment:2 by pulkomandy, 12 years ago

The first patch looks fine.

The second one is not :) When translating stuff that ends up built in libbe, you can't use the usual system to get your catalog. The current solution is to have a special catalog just for that purpose.

This special catalog is reached by the special LocaleBackend() class and the instance pointer gLocaleBackend. Your B_TRANSLATE macro does that properly, but you need to call it when translating something. As this is not the normal B_TRANSLATE_MACRO, the collectcatkeys tool will not see it, and you also have to use B_TRANSLATE_MARK on the strings constants (which you did just fine). So, just add the missing B_TRANSLATE calls (likely when filling in the BMessage that is sent to the preflet ?) and it should be fine.

As for add-ons, they can use the regular catalog system without any problem (get the english text from resources, then translate). As they are add-ons, they don't have to go through libbe and it _should_ work as usual.

comment:4 by pulkomandy, 9 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev48417.

Note: See TracTickets for help on using tickets.