l2"
From Documentation
m (correct highlight (via JWB)) |
|||
Line 11: | Line 11: | ||
The label is based on the current Locale (<javadoc method="getCurrent()">org.zkoss.util.Locales</javadoc>). | The label is based on the current Locale (<javadoc method="getCurrent()">org.zkoss.util.Locales</javadoc>). | ||
− | For example, let us assume we want to generate a full name based on the current Locale, then we could use < | + | For example, let us assume we want to generate a full name based on the current Locale, then we could use <code>${c:l2('key',args)}</code> to generate concatenated messages as follows. |
<source lang="xml" > | <source lang="xml" > |
Latest revision as of 13:26, 19 January 2022
String l2(String key, Object[] args);
Returns the label of the given key defined in the internationalization labels, and formats it with the given arguments. The formatting is done by the use of MessageFormat.
The label is based on the current Locale (Locales.getCurrent()).
For example, let us assume we want to generate a full name based on the current Locale, then we could use ${c:l2('key',args)}
to generate concatenated messages as follows.
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<label value="${c:l2('fullname.format', fullname)}">
where we assume fullname is a string array (such as new String[] {"Jimmy", "Shiau"}
).
Version History
Version | Date | Content |
---|---|---|