On Oct 6, 2013, at 3:45 PM, Laurent Cerveau wrote: > I am using NSPredicateEditor to display some predicates and after a few > fights all is now fine. A feature I find particularly convenient is the use > of a formatting dictionary to display user friendly sentences to a user. > In another part of my application, I show some data computed based on the > edited predicate and I would like to show the predicate that originates this > result but in a "human friendly way". So I thought I would reuse this > dictionary/strings file. > So basically I would like to have code like > NSLocalizedString(predicate.predicateFormat, nil); > > However predicateFormat does not seem to return "proper localizable > predicate". That is for example > loc name BEGINSWITH "MM" > and not > loc name begins with "MM" > > Or > volumeType == 27 > > while I have > > volumeType is 27 > > in the strings file. > > Is there a way to convert between the 2 (or do I miss a point?)
It is not the canonical way to use localization, but you theoretically should be able to use it in this way, as long as all of your predicate strings are static and have an exact character for character match in your Localizable.strings or equivalent file. IMHO it would be better to simply have a translation routine that converts predicates to a desired plain-language that itself could be properly localized to produce, for instance, "volumeType est de 27" as well. HTH, Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
