Multiple sets of resource bundles

Hi,
Can we have multiple sets of resource bundles in vaadin… We have various categories including UI component labels, Error messages, etc…need to be internationalized. Can I keep them in separate set of resource bundles.For ex : All UI component labels, messages goes to Lables.properties bundles and all error messages goes to ErrorMessages_en.properties bundle…
I have checked the schema definition for portlet.xml (http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd). The “maxOccurs” values of resource-bundle element is 1.
(default of maxOccurs is 1)
So I can not define two resource bundles for one portlet.

Any ideas…
Thank you,

Any idea about this…
I am also using spring framework…Can i ask my portlet to look for another resource bundle via spring’s xml files…

HI,

Vaadin at it’s core does not use, touch or indeed know anything about Resource Bundles.

Reading between the lines, you seem to be talking specifically about Portlets; I’m afraid I know nothing at all about Portlet’s, but from what you say, the Portlet can only support a single resource bundle.

Looking at http://developers.sun.com/portalserver/reference/techart/i18n-portlets.htm , as far as I can see, you repeatedly specify which bundle to use anyway - I am guessing that the portlet container only uses the resource bundle from the portlet.xml to pick up the title, short-title and keywords if specified in the portal.xml.

You could build your own Resourc Bundle class(es) that are composite (or forward to a Spring MessageSource).

Really, it depends on precisely what you are trying to do.

So in Summary :

  • Resource Bundles are outside of Vaadin’s scope
  • The Portlet spec allow you to define a single resource bundle per portlet. This is used for title, short-title etc - but can be overridden.
  • Build a simple composite resource bundle class, if you want to check in multiple bundles.

Cheers,

Charles.

Thank you. I have found ‘spring’ way of adding another set of resource bundle. So one resource bundle handled by portlet.xml and another one by spirng’s context.xml. It works fine now.

in case anyone is interested…
http://www.mkyong.com/spring/spring-resource-bundle-with-resourcebundlemessagesource-example/