If you're using Wonder and WOOGNL you can do:

WOOgnl.setAssociationClassForPrefix(ERXLocalizerAssociation.class, "loc");

and then you can use (I believe the syntax is):

value = loc:localizationKey;

I seem to recall 5.4 has some similar syntax, but I don't know anything about it.

You can also just use ERXLocalizedString component for the "less fancy" way.

ms

On Oct 22, 2008, at 12:24 AM, George wrote:

Question
Is there a way I can bind a declaration in my WOD file directly to a key/value pair in a WebObjects Properties resource file? I want to externalise the majority of my HTML text [heading’s etc] without creating a java WOString/binding for each heading and bit of static text in my html file.

Background
In Apache struts I would use the bean message taglib where I can specify a resource bundle and a resource key. When the page is resolved the value for the key in the resource bundle will be displayed [on the html page]. In this way I can externalise the majority of my html text to Resource files [Properties], and change them without re-deploying applications etc.

An Example
MyPage.html
<!--  My declaration for a static html string  ->
<webobjects name=’PageStaticHeading1’ />

MyPage.wod
// the WO declaration that will bind to key/value in a Properties file
PageStaticHeading1: WO<something like String I guess> {
resourceBundle = PropertiesPageHeadings; // specify the resource bundle to use resourceKey = ‘<mysite>.<mypage>.<myheading1>; // specify a key in the resource bundle
}

PropertiesPageHeadings.properties_English
# my English resource bundle for static html bits
‘<mysite>.<mypage>.<myheading1> = My name is George;

PropertiesPageHeadings.properties_FR
# my French resource bundle for static html bits
‘<mysite>.<mypage>.<myheading1> = Je m'appelle Georges;


_______________________________________________
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