-
1. Re: Internationalization
yxyang Aug 8, 2006 10:02 PM (in response to vanei)Yes. it is true.
Internationalization is not implemented for portlet title.
It seems that it is required to change the RenderSet classes etc to make the portlet title Internationalization.
Any suggestion?
yang -
2. Re: Internationalization
yxyang Aug 8, 2006 10:37 PM (in response to vanei)It seems that the internationalization of the portlet title in jbossportal 2.2.1 is not implemented yet. Is this true?
After i went through the DivDecorationRenderer.java class, it found that the Render class just display the WindowResult.title directly.
To solve this problem, i need to do small modification on this.
There are two ways to do this:
(1)use resourcebundle which can be retrieved from the classloader.
(2)use portlet preference.....when a portlet instance is created, according to the locale of the request come from to initialize a title related portlet preference.
What is the better way? or any recommendation?
yang -
3. Re: Internationalization
julien1 Aug 10, 2006 5:16 AM (in response to vanei)Internationalization of title should happen only if you extend GenericPortlet that takes the title from the resource bundle according to the locale.
-
4. Re: Internationalization
yxyang Aug 11, 2006 9:57 PM (in response to vanei)julin
why not include this feature in the jbossportal? I think this is an important feature/actually, it is a bug in current jboss portal.
Bug and feature is difficult to define :-)
yang -
5. Re: Internationalization
julien1 Aug 12, 2006 8:50 AM (in response to vanei)I meant that this is automatically provided by the javax.portlet.GenericPortlet implementation.
The portal (in particular the theme engine) itself cannot do anything about it because it does not have access to resource bundles (in the remote case). -
6. Re: Internationalization
yxyang Aug 12, 2006 10:15 AM (in response to vanei)julien written:
Normally it is done at runtime if your portlet extends the GenericPortlet which contains :
protected String getTitle(RenderRequest request)
{
ResourceBundle bundle = getResourceBundle(request.getLocale());
return bundle.getString("javax.portlet.title");
}
If you produce the correct resource bundle it should work.
After testing, i found that thegetResourceBundle(request.getLocale());
has some problem and it can only load English resource.
However, if i use
ResourceBundle bundle = ResourceBundle.getBundle("resourceBundle",
request.getLocale(),getClass().getClassLoader());
then it works.
Why? For me, it seems that the Portlet configuration implemention has some bug because it cannot get the resource bundle correctly according to the resource configuration for the portlet.
regards
yang -
7. Re: Internationalization
julien1 Aug 12, 2006 10:20 AM (in response to vanei)what version are you trying ?
did you give a try to latest 2.4 CR3 ? we have put a bunch of test case to test that functionnality.
if you find a behavior that does not respect the portlet specification, please describe it and we'll implement the corresponding test case and fix it. thanks. -
8. Re: Internationalization
yxyang Aug 12, 2006 10:26 AM (in response to vanei)i am using jbp 2.2.1. It is for production server usage.
Fortunately, at least one workaround is available....
regards
yang -
9. Re: Internationalization
yxyang Aug 12, 2006 10:38 AM (in response to vanei)the portal supporting internationalization is one thing.
More importantly, the portlets coming with jboss portal should have full internationalization support and pattern for internationalization. So that other users will follow the same pattern to code and share the usable portlets. Otherwise, later, even jboss portal has very good internationalization support, but there are no reusable portlets because none of them implement internationalization properly.
Hope jbp team will see the benifit of this. :-)
thanks
yang