Wonder supports localized attributes already ... repost this on the Wonder list and I'm sure Anjo can tell you how to do it.

ms

On Jul 12, 2007, at 11:08 AM, Johann Werner wrote:

Hi all,

sorry to bother the list but I am stuck.

in short: I want to make some EOs behave localized.


long story: In my project I have some fixed lists as e.g. salutations that are saved in the db. There I want to use the approach of the localizable.strings lookup (I am using ERXLocalizer from WOnder). To make this process transparent I had the idea to modify the accessors of the eo to look up the value in the db and then based on the current language setting retrieve the correct localized string from the .strings file. So I would call the accessor as any other but get a result based on the used language.

For lists that are user editable I use another approach by replacing the string in the entity by a to-many relationship pointing to an eo with a localized string and a language code. So in this case the eo should get the current language setting and then choose the correct subentity from the to-many relationship and return the appropriate localized string.

Unfortunately the language settings are accessed by session ().localizer() and there is apparently no way to access the current session object from within an eo. I know I could pass the current session (or only the code for the current language) through by an argument but then I can't use bindings in components without writing intermediate access functions resulting in more unnecessary code and no transparent use of that eo would be possible.


As I am new to localization in WO I don't know if my ideas go perhaps into the wrong direction. I would be very thankfull if someone could give me a hint if the descibed approach is advisable or if there is another (more elegant) way to resolve the problem.

jw _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag% 40mdimension.com

This email sent to [EMAIL PROTECTED]


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to