How to implement bilingual in Messagebox.show() in zk?

1.2k views Asked by At

I am using Messagebox.show() in my application .But my issue is that our application support bilingual just english and french .I use pageResourceBundle.getText() for bilingual support in my code "CONFIRMATION_MSG" work fine for bilingual but the Messagebox.YES | Messagebox.NO button can not change english to french .

Here's example :

Messagebox.show(pageResourceBundle.getText("CONFIRMATION_MSG"), pageResourceBundle.getText("ALERT"), Messagebox.YES | Messagebox.NO,
                    Messagebox.QUESTION, new org.zkoss.zk.ui.event.EventListener<Event>() {
                        public void onEvent(Event evt) throws InterruptedException {
                            if (evt.getData().equals(Messagebox.YES)) {
//code here

}

Anyone have any idea how to implement in the Messagebox.YES | Messagebox.NO button to bilingual .

Thanks

1

There are 1 answers

0
chillworld On BEST ANSWER

Zk already support the bilangual in the messagebox. You just have to set you Locale to the right one.

Why don't you use the provided i18n in zk?

http://books.zkoss.org/wiki/ZK_Developer's_Reference/Internationalization/Labels