On 1/3/07, mraible <[EMAIL PROTECTED]> wrote:
Is it possible to use multiple i18n resource bundles with JSF? I'd like to
have a messages.properties for labels, messages and such and an
errors.properties for validation errors. I'd be happy to move to JSF 1.2if
that's a feature not present in 1.1.
In JSP syntax:
<f:loadBundle var="labels" bundleName="com.mycompany.MyLabelsBundle"/>
<f:loadBundle var="errors" bundleName="com.mycompany.MyErrorsBundle"/>
...
<h:outputLabel for="username" value="#{labels['username.label'}"/>
...
<h:outputText value="#{errors['error.key']}"/>
For Facelets or Clay, use the corresponding equivalent to loadBundle to load
multiple individual bundles.
The only restriction is that JSF itself accepts only one resource bundle
name in which to look up replacements for the standard conversion and
validation error messages (section 2.5.2 in the JSF spec).
Thanks,
Matt
Craig