-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Could somebody provide me with a clear example of localization lables in zul page.
I have property files: net.app.texts.properties, net.app.texts_uk.properties, etc.
with texts:
windowMain.questionnaire_tooltiptext=Questionnaire
windowMain.exit_tooltiptext=Exit
.....
how to use these in zul page element?
<button tooltiptext="???" />
Very nice ! Thank you, sousa1981
1) I put "i3-label_*_*.properties" files in WEB-INF.
2) I used next code in zul page:
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" ?> <button tooltiptext="${c:l('windowMain.questionnaire_tooltiptext')}" />
Also I tryed use MVEL, as you write above
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" ?> <?evaluator name="mvel"?> <button tooltiptext="${Labels.getLabel('windowMain.questionnaire_tooltiptext')}" />
You helped me, thank you very much !
Search the forum you will found answers.
1) properties
2) In \WEB-INF\i3-label.properties + \WEB-INF\i3-label_pt_PT.properties + etc
3) What about an zul example:
<?xml version="1.0" encoding="utf-8"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" ?> <?evaluator name="mvel"?> <?page title=".:: VIC ::."?> <window width="99%" xmlns:zk="http://www.zkoss.org/2005/zul" xmlns:n="http://www.zkoss.org/2005/zk/native" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd"> <zk:label value="${Labels.getLabel('username')}:" /> </window>
I am using MVEL so you will need MVEL jar in your classpath.
What about in java source code:
import org.zkoss.util.resource.Labels;
Labels.getLabel("username");
BONUS: You could use properties like copyright.year=2005-2008
Hope it helped you.
Ok I write my questions in other manner
1) What format of property files ZK use (properties or XML)?
2) Where I have to save my properties files (under /WEB-INF or classes directories)?
3) Where I have to write name and path for my properties files on ZUL page?
In documentation I don't see answers... so I ask any example.
I think your problem is in your properties file, perhaps?
Thank you, but I spent about 4h for this article and didn't get any result.
I think it has to be 2-3 lines in zul page for get acces to my bundle *.properties files. But I dont know how to read properties files in ZUL, I see only reading TLD files...
When I try to read properties file, i get error:
org.zkoss.lang.SystemException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
check this default i18n implementation.
http://www.zkoss.org/doc/devguide/ch13.html
Asked: 2008-08-09 13:07:28 +0800
Seen: 536 times
Last updated: Aug 11 '08