留言板
Liferay 7: localize portlet title
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?
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?
David H Nebinger,修改在7 年前。
RE: Liferay 7: localize portlet title
Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
The source is always a good reference, here's an example for the dictionary portlet:
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.
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.
Alexey Kakunin,修改在7 年前。
RE: Liferay 7: localize portlet title
Liferay Master 帖子: 621 加入日期: 08-7-7 最近的帖子
Hi David! Thank you for you help - using package (instead of bundle name) working.
David H Nebinger,修改在7 年前。
RE: Liferay 7: localize portlet title
Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Happy to help, Alexey!