struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4295) provide better documentation and / or functionality for localization of struts2 tag elements (select, radio, etc.)
Date Fri, 27 Jun 2014 11:24:25 GMT

    [ https://issues.apache.org/jira/browse/WW-4295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14045832#comment-14045832
] 

ASF subversion and git services commented on WW-4295:
-----------------------------------------------------

Commit d20c2f10b7ccb2830eb255062b45941684b55336 in struts's branch refs/heads/feature/WW-4295-localization
from [~lukaszlenart]
[ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=d20c2f1 ]

Merge branch 'develop' into feature/WW-4295-localization

Conflicts:
	core/src/site/resources/tags/checkboxlist.html


> provide better documentation and / or functionality for localization of struts2 tag elements
(select, radio, etc.)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-4295
>                 URL: https://issues.apache.org/jira/browse/WW-4295
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.16
>            Reporter: adam brin
>             Fix For: 2.3.18
>
>         Attachments: WW-4295.patch
>
>
> The <@s.text> macro is very useful for localization of text values.  The <@s.textfield
tag also takes a "key" > but, the select, radio, and checkbox options don't have good options
for localization.  One option raised on the list and identified in a few places is to construct
a separate map of variables that have been localized in Freemarker and use that for localization
(https://stackoverflow.com/questions/5548104/struts-select-tag-localization-implementation/17258640#17258640)...
this does not seem sustainable or maintainable. Two possible methods for addressing this might
be:
> # update the documentation to better identify how to localize these values in the "approved"
way
> # implement a listKey parameter that like the textfield implementation or other implementations
might call getText() on the key prior to rendering
> {code:title=Example Implementation for Radiobutton}
>     <#if parameters.listKey??>
>         <#assign itemValue><@s.text name="${stack.findString(parameters.listKey)}"
/><#rt></#assign>    
>     <#elseif parameters.listValue??>
>         <#assign itemValue = stack.findString(parameters.listValue)/>
>     <#else>
>         <#assign itemValue = stack.findString('top')/>
>     </#if>
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message