Fórum

Liferay 7: localize portlet title

thumbnail
Alexey Kakunin, modificado 7 Anos atrás.

Liferay 7: localize portlet title

Liferay Master Postagens: 621 Data de Entrada: 07/07/08 Postagens Recentes
Hi!

Checking Liferay Blade Samples I see - what for complex osgi module names (like blade.portlet.jsp) language constants generated by using module name (with replacing dots with _) and portlet class name: https://github.com/liferay/liferay-blade-samples/blob/master/maven/blade.portlet.jsp/src/main/resources/content/Language.properties

So, for portlet JSPPortlet in bundle blade.portlet.jsp used constant blade_portlet_jsp_JSPPortlet

Unfortunately it does not work in Liferay 7.0.1 - even I do any changes in this file - display-name from defined in class is used.
Question - what the correct rule to generate localization constants for this case?
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7: localize portlet title

Liferay Legend Postagens: 14918 Data de Entrada: 02/09/06 Postagens Recentes
The source is always a good reference, here's an example for the dictionary portlet:

javax.portlet.title.com_liferay_dictionary_web_portlet_DictionaryPortlet=Dictionary


javax.portlet.title is the same prefix, following that is the portlet name, which for LR7 is the package (with . replaced with _) and class for the portlet.

Since your example is always using the DisplayName value from the annotations, that would imply it is not finding an appropriate match from the language bundle.
thumbnail
Alexey Kakunin, modificado 7 Anos atrás.

RE: Liferay 7: localize portlet title

Liferay Master Postagens: 621 Data de Entrada: 07/07/08 Postagens Recentes
Hi David! Thank you for you help - using package (instead of bundle name) working.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7: localize portlet title

Liferay Legend Postagens: 14918 Data de Entrada: 02/09/06 Postagens Recentes
Happy to help, Alexey!
thumbnail
Daniel Tsai, modificado 2 Anos atrás.

RE: Liferay 7: localize portlet title

New Member Postagens: 2 Data de Entrada: 29/09/15 Postagens Recentes
This information saved me, thank you, David!