Feature Requests item #556766, was opened at 2002-05-16 09:37
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=354754&aid=556766&group_id=4754
Category: framework
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Howard Lewis Ship (hship)
Assigned to: Howard Lewis Ship (hship)
Summary: Improve localization support
Initial Comment:
Tapestry needs improved localization support.
Every component should have the option of localizing
messages using multiple HTML templates, or using a
property resource bundle (a set of
localized .properties files) (or a combination of the
above).
A new binding, for extracting a localized string from
the properties files would be useful. Example:
<component id="insertMessage" type="Insert">
<string-binding name="value"
property="a.message.key"/>
</component>
Note that the key is simply a key, not a property path.
IComponent should have additional methods for
obtaining a localized ResourceBundle for the component.
To be discussed:
Should there be an inheritance chain? If a component
does not have the specified key, should the search
continue in the containing component? Containing
page? Engine?
There may be some use to allowing access to these
using property bindings, i.e.,
<binding name="value" property-path="strings.
{a.message.key}"/>
Note the big change, use of a delimiter to identify a
key that contains dots.
Simple HTML:
This is going to occur often enough that I support
bending the rules for Tapestry HTML templates. I
would like HTML templates to look like:
<span property="a.message.key">Default Text</span>
This would act like a kind of macro, automatically
creating an object, or anonymous Insert, that
retrieves the specified key from the localized strings
and replaces the entire <span> tag with it. Again,
this would support WYSIWYG, since "Default Text" would
appear when the HTML producer is working on the
template.
This would look specifically for "span" tags with
a "property" attribute.
This would involve a change to HTML parser.
Note that under this scheme, the use of multiple HTML
templates would take on a very different usage, I
suspect: The ability to change L&F for a page based
on locale ... you'd use a different HTML template for,
say, Hebrew than for English, to reflect the
orientation difference (English is left to right,
Hebrew is right to left).
----------------------------------------------------------------------
Comment By: Howard Lewis Ship (hship)
Date: 2002-05-20 12:24
Message:
Logged In: YES
user_id=26816
I will extend IComponent with the following method:
public String getLocalizedString(String key);
Returns the localized version of the String (localized to
the containing page's locale). If a property with that key
doesn't exist, a modified version of the key itself is
returned (converted to upper-case, enclosed in right
brackets).
P.S. I hate that Struts blows up when a message key can't
be found. Better to highlight the error and continue.
----------------------------------------------------------------------
Comment By: Tom Davies (tomdavies)
Date: 2002-05-19 10:30
Message:
Logged In: YES
user_id=289547
I like the 'simple HTML' approach.
I'd like this to call a Page or Engine function which can be
overidden -- something like:
String getI18NString(String key, Locale l)
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2002-05-16 11:32
Message:
Logged In: NO
Ok. trying again...
thanks howard for reconstucting my original request.
Inheritance is not important to me.
The Macro idea would address my needs perfectly.
Geoff
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2002-05-16 11:32
Message:
Logged In: NO
Ok. trying again...
thanks howard for reconstucting my original request.
Inheritance is not important to me.
The Macro idea would address my needs perfectly.
Geoff
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2002-05-16 11:30
Message:
Logged In: NO
Howard, thanks for reconstruction my original request. It
had slipped my mind or I woulda done it myself.
As for points to discuss,
Inheritance = not important to me
Macro/Annoymous Insert = YES! that would address my needs
perfectly!
Geoff
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=354754&aid=556766&group_id=4754
----------------------------------------------------------------------------
Bringing you mounds of caffeinated joy
>>> http://thinkgeek.com/sf <<<
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer