GitHub user abrin opened a pull request:

    https://github.com/apache/struts/pull/7

    [PATCH] First attempt at enabling value-labels to be pulled from

     Locale Files.  Adding listValueKey attribute to checkboxList, radioMap, and
     select tags.
    
    Issues:
    This implementation uses the <@s.text> tag to handle the localization with 
an assignment. I presume this is less than idea, but I lack the knowledge of 
the Struts2 tag model that would suggest where to check for this on the 
valueStack or elsewhere.
    
    Example:
    
    public enum yesno {
    YES, NO;
    }
    
    <@s.radio name="yes no" list="#{yesno.values()}" valueKey="name()" />
    
    <!-- this will look for the name() in the locale file and emit the 
localized value for the label of the radio button.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/abrin/struts feature-WW-4295-localization

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/7.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #7
    
----
commit 7f586d39b7f8411e22fd13de8025f1866477fc3c
Author: adam brin <[email protected]>
Date:   2014-03-18T14:36:28Z

    [PATCH] First attempt at enabling value-labels to be pulled from
     Locale Files.  Adding listValueKey attribute to checkboxList, radioMap, and
     select tags.
    
    Issues:
    This implementation uses the <@s.text> tag to handle the localization with 
an assignment. I presume this is less than idea, but I lack the knowledge of 
the Struts2 tag model that would suggest where to check for this on the 
valueStack or elsewhere.
    
    Example:
    
    public enum yesno {
    YES, NO;
    }
    
    <@s.radio name="yes no" list="#{yesno.values()}" valueKey="name()" />
    
    <!-- this will look for the name() in the locale file and emit the 
localized value for the label of the radio button.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to