On Oct 28, 2008, at 1:12 PM, Markus Spoettl wrote:

Hello List,

is there a way to make NSPredicateEditor play nice with localized versions of an application, meaning that it's rule operators and criteria are translated to the language the rest of the application is using?

Right now it appears that NSPredicateEditor uses English operator names (and compound criteria descriptions), regardless of which language is used.

Regards
Markus


Hi Markus,

Apple does not provide any translations of the operator names or criteria. This is because NSPredicateEditor is designed to be localized with sentence granularity, not word by word. Translating each word independently and piecing them together doesn't produce as good a localization.

For example, in Finder, you can search for "[Last modified date] is [within last] [5] [weeks]". That whole sentence is what gets localized - it appears in a strings file in Finder's bundle - and there can be a separate localization for each possible sentence.

There's an example of a NSRuleEditor localized into Spanish at http://homepage.mac.com/gershwin/NibBasedSpotlightSearcher.zip (NSPredicateEditor's localization is identical). Also see NSNavRuleEditor.strings inside AppKit.framework/*.lproj for how the search in the Open panel gets localized.

Of course, you can localize each word independently if you prefer, with the usual mechanism - set the title of each menu item in each popup to the translation you want.

Let me know if you have any questions,
-Peter

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to