Fórum

liferay-ui:message tag not using resource bundle

Thomas Kellerer, modificado 6 Anos atrás.

liferay-ui:message tag not using resource bundle

Expert Postagens: 490 Data de Entrada: 09/06/08 Postagens Recentes
I have a resource bundle in my portlet which is used without problems e.g. by
<aui:input key="form.contact.message" name="message" type="text" /><br>

However, the liferay-ui:message does not use my resource bundle:
<liferay-ui:message key="label.contact.thank.you" />

is rendered as "label.contact.thank.you" on the page.

Both keys are in the same .properties file, so why does one tag use it, but the other doesn't?

My init.jsp contains the following:

&lt;%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %&gt;
&lt;%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %&gt;
&lt;%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %&gt;
&lt;%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %&gt;
&lt;%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %&gt;
&lt;%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %&gt;

<liferay-theme:defineobjects />
<liferay-frontend:defineobjects />
<portlet:defineobjects />


Do I need to add something else so that lifery-ui is also aware of the resource bundle?

This is with Liferay 7 GA4
Selva kumar, modificado 5 Anos atrás.

RE: liferay-ui:message tag not using resource bundle

Junior Member Postagens: 39 Data de Entrada: 23/07/15 Postagens Recentes
Did you find the solution? if so can you share it?
sahil garg, modificado 5 Anos atrás.

RE: liferay-ui:message tag not using resource bundle

New Member Postagens: 9 Data de Entrada: 13/03/17 Postagens Recentes
Hi,

Please add following declaration in init.jsp
<%@ taglib prefix="liferay-ui" uri="http://liferay.com/tld/ui" %>
and let me know.

Thanks
Selva kumar, modificado 5 Anos atrás.

RE: liferay-ui:message tag not using resource bundle

Junior Member Postagens: 39 Data de Entrada: 23/07/15 Postagens Recentes
Hi

I have already included the import in the jsp and the below code didn't resolve its value from the properties file. It is working fine in LFR 6.2.

<liferay-ui:message key="label.name"></liferay-ui:message>

Thanks.