[
http://www.stripesframework.org/jira/browse/STS-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12075#action_12075
]
Nikolaos commented on STS-433:
------------------------------
I looked over Iwao's patch and as it turns out there is a really simple way to
add the desired functionality in a very clean way.
Essentially the superclass InputTagSupport in its doEndTag method after calling:
int result = doEndInputTag();
Need simply do the following:
String name = getAttributes().get("name");
if (name != null) { // Skip title lookup if no name to
lookup against
String title = getLocalizedFieldName(name + ".title");
if (title != null) { setTitle(title); }
}
And then add the following at the bottom:
public void setTitle(String title) { set("title", title); }
public String getTitle() { return get("title"); }
All of this has the net effect of aligning to how Stripes build other localized
attributes like the "alt" attribute for the "image" tag.
And the best of both worlds are available. If a hardcoded value for title is
provided in the input tag then it is used otherwise if the title attribute does
not exist then Stripes uses the same mechanism of FQ-name and non-FQ-name to
lookup the value in the resource bundle. If the title attribute is neither
hard coded or provided in the resource bundle then no title attribute is
included in the tag.
I'll attach the full patch file as STS433_PATCH_VERSION_2.txt
--Nikolaos
> Localize title attribute for Stripes tags.
> ------------------------------------------
>
> Key: STS-433
> URL: http://www.stripesframework.org/jira/browse/STS-433
> Project: Stripes
> Issue Type: Improvement
> Components: Tag Library
> Affects Versions: Release 1.5
> Environment: Mac OS X 10.4.10, Java 1.5.0_07
> Reporter: Iwao AVE!
> Priority: Trivial
> Attachments: STS-433.patch
>
>
> It would be nice if Stripes tag localizes its title.
> So that we can write
> <stripes:text name="user.address" title="user.address.title" />
> instead of
> <fmt:message var="userAddressTitle" key="user.address.title" />
> <stripes:text name="user.address" title="${userAddressTitle}"/>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development