From Documentation

labels - java.util.Map

A map of all internationalization labels belonging to the current locale (Locales.getCurrent()).

For example, if you have a property file as follows:

owner=Foo Inc.
application.title=Killer 2011

Then, you could access them with this implicit object as follows.


Notice that the key of a property could be name as key1.key2, and EL expressions could retrieve them correctly. More precisely, ZK groups the segmented labels as map. For example, ${} was resolved as a map containing two entries (title and description).

app.description=A super application

If you have a key named as the prefix of the other keys, you have to use $ to access it. For example, ${$} is required to resolve the label with key named app.

app.description=A super application

Under the hood: The labels object is actually the map returned by Labels.getSegmentedLabels(). Furthermore, if the key of a property contains dot (.), all properties with the same prefix are grouped as another map. For example, ${labels.application} (i.e., Labels.getSegmentedLables().get("application")) will return a map containing two entries (name and title) in the previous example.

Version History

Version Date Content
5.0.7 March, 2011 This implicit object was introduced.

Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.