brianchandotcom/liferay-portal — pull request #6585 by epgarcia (2012-08-22 14:28:19+00:00)
Title: LPS-28904 Support title and description translation for multi-portlet plugins

The method *javax.portlet.GenericPortlet.render(renderRequest, renderResponse)* set the title of the renderResponse to the value obtained by the method *GenericPortlet.getTitle(renderRequest)*. By default this method obtains the portletTitle as:

config.getResourceBundle(request.getLocale()).getString("javax.portlet.title");

Afterwards some portlets may set a custom title in the renderResponse. For example, the login portlet changes the title of the renderResponse to "Create Account", "Log In", "Sign In" when needed. Thus, the portletTitle to be displayed at portlet.jsp MUST be recovered from the renderResponse and not directly from language resource bundle, in order to keep this feature working.

Since our LiferayPortlet class (extending GenericPortlet) does not override getTitle(renderRequest), it will never return a title defined with our non-standard format javax.portlet.title.. To support this feature, I have overriden the GenericPortlet.getTitle at LiferayPortlet, so that it first try to recover the title in our non-standard way, and if it fails it does it as in GenericPortlet. This is actually the recommended way to provide dynamic titles (see http://portals.apache.org/pluto/portlet-2.0-apidocs/javax/portlet/GenericPortlet.html#getTitle(javax.portlet.RenderRequest)).

I've tested it and portlet titles are properly translated. Portlets changing/recovering their portletTitle through renderResponse (as login portlet) work fine, too. This case was not considered in the previous pull-request.

@juliocamarero