Index: stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java =================================================================== --- stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java (revision 620) +++ stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java (working copy) @@ -15,6 +15,7 @@ package net.sourceforge.stripes.tag; import net.sourceforge.stripes.exception.StripesJspException; +import net.sourceforge.stripes.localization.LocalizationUtility; import net.sourceforge.stripes.util.Log; import net.sourceforge.stripes.util.HtmlUtil; @@ -25,6 +26,7 @@ import javax.servlet.jsp.tagext.DynamicAttributes; import java.io.IOException; import java.util.HashMap; +import java.util.Locale; import java.util.Map; /** @@ -195,6 +197,12 @@ * @throws IOException if the JspWriter causes an exception */ protected void writeAttributes(JspWriter writer) throws IOException { + // If title is specified, try localizing it. + String title = getAttributes().get("title"); + if (title != null) { + localizeTitle(title); + } + for (Map.Entry attr: getAttributes().entrySet() ) { // Skip the output of blank attributes! String value = attr.getValue(); @@ -208,6 +216,13 @@ } } + protected void localizeTitle(String title) { + Locale locale = getPageContext().getRequest().getLocale(); + String localizedTitle = LocalizationUtility.getLocalizedFieldName(title, null, locale); + if (localizedTitle != null) { + getAttributes().put("title", localizedTitle); + } + } /** * Evaluates a single expression and returns the result. If the expression cannot be evaluated Index: stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java =================================================================== --- stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java (revision 620) +++ stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java (working copy) @@ -239,6 +239,22 @@ return LocalizationUtility.getLocalizedFieldName(name, actionPath, locale); } + @Override + protected void localizeTitle(String title) { + Locale locale = getPageContext().getRequest().getLocale(); + String actionPath = null; + + try { + actionPath = getParentFormTag().getAction(); + } + catch (StripesJspException sje) { /* Do nothing. */} + + String localizedTitle = LocalizationUtility.getLocalizedFieldName(title, actionPath, locale); + if (localizedTitle != null) { + getAttributes().put("title", localizedTitle); + } + } + /** * Attempts to format an object using the Stripes formatting system. If no formatter can * be found, then a simple String.valueOf(input) will be returned. If the value passed in