Localization using portlet resource bundles?

How can I access portlet resource bundles within Vaadin Application?

If I extend ApplicationPortlet2 I can access them with getResourceBundle method but how do I pass it to Application object?

I would like to use them for localization.

If you want to do it the standard way (according to
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Localization+of+Portlets+Outside+of+Liferay
) you need to extend ApplicationPortlet2 and either access the resource bundles there or store a reference to the PortletConfig object and then pass it along somehow to the application. One way would be to override getNewApplication() and pass a reference to the application right after it has been created (by super.getNewApplication()).

Another way to get access to the ResourceBundle is to use the standard java ResourceBundle.getBundle(“mybundle”, locale) provided the classloader finds “mybundle” from the classpath.

I also created an
enhancement ticket
for this to provide a better way in the future.