Foros de discusión

language.properties file

Abhi Ed, modificado hace 11 años.

language.properties file

Regular Member Mensajes: 118 Fecha de incorporación: 4/06/12 Mensajes recientes
Hello friends ,

In language.properties, I can see following parameters .
warning-your-session-will-expire=Warning! Due to inactivity, your session will expire in {1} minute(s) . Session will time out after {0} minutes of activity.

From which files these parameterized arguments are fetched ?
thumbnail
David H Nebinger, modificado hace 11 años.

RE: language.properties file

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
They are not fetched, they are passed arguments that the resource bundle uses. When you call the resource bundle and pass the key, you also pass the parameters and the {0}, {1}, etc. will be replaced with the parm values.
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: language.properties file (Respuesta)

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
The message is actually used in JavaScript statement below and parameters are passes as below.

instance._warningText = Liferay.Language.get('warning-your-session-will-expire');
instance._warningText = Lang.sub(instance._warningText, ['<span class="countdown-timer">{0}</span>', host.get('warningLength') / 60000]);
Abhi Ed, modificado hace 11 años.

RE: language.properties file

Regular Member Mensajes: 118 Fecha de incorporación: 4/06/12 Mensajes recientes
Hitoshi Ozawa:
The message is actually used in JavaScript statement below and parameters are passes as below.

instance._warningText = Liferay.Language.get('warning-your-session-will-expire');
instance._warningText = Lang.sub(instance._warningText, ['<span class="countdown-timer">{0}</span>', host.get('warningLength') / 60000]);



Thanks Hitoshi for clarification!!!