0

I have a jboss seam 2.2.2 project and it is my first time using internationalization with this framework. I have already set the default locale and using the global messages_XX.properties is already working. Well, this project is growing fast and for better organization and for ease of maintance I would like to have the messages better organized in various properties files for specific pages. Seam documentation on internationalization mention this and in a specific paragraph it says:

If you want to define a message just for a particular page, you can specify it in a resource bundle with the same name as the JSF view id, with the leading / and trailing file extension removed. So we could put our message in welcome/hello_en.properties if we only needed to display the message on /welcome/hello.jsp

This paragraph can be found at: http://docs.jboss.org/seam/2.2.2.Final/reference/en-US/html/i18n.html#d0e14166

The docs mention pages with .jsp extension but in my case I am using facelets and what I have is a .xhtml file so for my home.xhtml page I have created a home_pt_BR.properties file being pt_BR the default locale for my app and I have placed messages for this specific page in this .properties file.

Actually this approach did not work for me.

I have also tryed to register the page in faces-config.xml and also in pages.xml but again this does not seem to work.

So, how do I configure Seam to support multiple bundle files for my application?

1 Answer 1

1

You could add the bundle files to components.xml

For example:

<core:resource-loader>
    <core:bundle-names>
        <value>messages</value>
        <value>strings</value>
    </core:bundle-names>
</core:resource-loader>
3
  • I am not exactly sure what did you suggested but I will take a look on this option. Could you be more specific? Where do I declare the bundle name? Is one bundle name for each value tag?
    – groo
    Nov 10, 2011 at 18:08
  • Hi, I took a look at the suggested aproach and in fact it does not satisfy my requirenments as it would be proibitive and a maintance-hell to keep track of all the bundle files in the system in the conponents.xml file. I would like to make the approach of keeping one bundle file for each file per language like seam doc suggest should work.
    – groo
    Nov 11, 2011 at 14:05
  • Actually your solution does not satisfy my requirements but as far as it looks like the only solution I will consider it correct. I still believe that there is some other simpler way of doing this or maybe I just missunderstood seam documentation on that.
    – groo
    Dec 21, 2011 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.