I'm running Jetspeed 2.2.0, and Velocity tools 1.3.

In my header.vm decorator, I'm using ResourceTool to retrieve translated
text.

Here is my tool configuration.

    <tool>
        <key>text</key>
        <class>org.apache.velocity.tools.generic.ResourceTool</class>
        <parameter name="bundles" value="com.sometranslatedresources"/>
        <parameter name="locale" value="en_US"/>
    </tool>

Both

   com.sometranslatedresources.properties
   com.sometranslatedresources_ja.properties

exist, but the only way I can get the Japanese translation to work is to
modify the velocity tool to have a default locale of "ja".

According to the documentation for ResourceTool
 (
http://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/generic/ResourceTool.html
 )

     *"and the default locale is either: the result of
HttpServletRequest.getLocale() (if used in request scope of a VelocityView
app)"*

The request has the correct locale from the browser configuration.

Here is my workaround in my velocity template.

     #set($tt = $text.locale($request.getLocale()))

This seems like it should not be necessary.  Has anyone else experienced
this problem and found a resolution?


Thanks.
Daniel

Reply via email to