Liferay-ui: icon localization

I am currently working on a portlet for the Liferay portal. I use constructs liferay-ui:iconin my JSP code that already support localization in different languages. However, now I have found one entry that does not seem to be localized:

<liferay-ui:icon image="add_article" message="add-article" label="true" url="${addUrl}" />

Everyone else works, but "add_article"no. Can someone help me? I know that there must be "Language.properties" files for different languages, and there must be a record action.ADD_ARTICLE=<the localized text>. Can someone give me a hint how can I solve this?

\ EDIT: I just found the corresponding Language.properties files in the portal-impl.jar. The record action.ADD_ARTICLEis both correctly localized and still, it does not appear localized in the user interface.

thanks

+3
source share
3 answers

Strings can be localized in the file ext / ext-impl / src / content / Language-ext_your locale.properties.

+1
source

I had the same problem here, this workaround worked for me:

<% String message = LanguageUtil.get(pageContext, "action.ADD_ARTICLE"); %>
<liferay-ui:icon image="add_article" message="<%= message %>" label="true" url="${addUrl}" />

Do not forget to import:

<% @page import="com.liferay.portal.kernel.language.LanguageUtil" %>

Hope this helps!

+1
source

You can also use hook to personalize localized strings.

0
source

Source: https://habr.com/ru/post/1708323/


All Articles