3
votes

I'm currently working on a portlet for the Liferay portal. I'm using the liferay-ui:iconconstructions in my JSP code which support already the localization in many different languages. However I now found one entry which doesn't seem to be localized:

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

All the others work, but the "add_article" doesn't. Can somebody help me? I know there should be somewhere "Language.properties" files for the different languages and there should be an entry action.ADD_ARTICLE=<the localized text>. Can someone give me a hint how I could solve this?

\EDIT: I just found the according Language.properties files in the portal-impl.jar. The entry action.ADD_ARTICLE is there and correctly localized and still, it doesn't appear localized on the UI??

Thanks

3

3 Answers

1
votes

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

1
votes

I had the same issue 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}" />

Remember to import:

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

Hope it helps!

0
votes

You can also use a hook to personalize the localized strings.