-
FEATURED COMPONENTS
First time here? Check out the FAQ!
We are using Internationalization Labels as described here: ZKDeveloper'sReference/Internationalization/Labels.
When label's key contains reserved word or operator, e.g.
"my-super.app.value1" or "mySuper.app.title.new", label's value can not be read with simplest approach suggested, "${labels.my-super.app.value1}" just does not work. EL thinks there is an expression:
my - super == 0
There is a second approach suggested:
If the key is not a legal name, you could use labels['key'] to access, such as labels['foo-yet']
But it does not work either, because expression "${labels['my-super.app.value1']}" is mapped to call "Labels.getSegmentedLabels()", so, the correct call would be like this:
"${labels['my-super']['app']['value1']}"
This form is too complicated. Yes we know we can use
"${c:l('my-super.app.value1')}"
but we think
Like anywhere else in zul files, ZK EL expressions follow the JSP Expression Language syntax rules, even if inconvenient at times, that's what it is. There's nothing specific to labels in this regard so it should not be documented redundantly.
If I'm not wrong, it should be possible to do just this as well:
${labels['my-super'].app.value1}
Asked: 2020-01-31 21:00:30 +0800
Seen: 11 times
Last updated: Feb 03 '20