1

How to change Language of Zk MessageBox Button Label

asked 2014-01-13 06:37:18 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I am getting one issue ,in my project supporting bilingual but i am getting one issue when i changed language from English to French it change the message but not the label like Ok or Cancel See attached screen shot.

image description

I used below code to change the language

public static void doChangeLanguage(String argLang) {
        SessionValidationInitiator.setLanguage(argLang);
        LOGGER.debug("Changing Language to ... " + argLang);
        if(argLang.equalsIgnoreCase("fr_ca")){
        Executions.getCurrent().getSession().setAttribute(Attributes.PREFERRED_LOCALE, Locale.FRENCH);
        }else{
            Executions.getCurrent().getSession().setAttribute(Attributes.PREFERRED_LOCALE, Locale.US);
        }
        Executions.sendRedirect(null);
    }
delete flag offensive retag edit

Comments

what zk version sjoshi?

chillworld ( 2014-01-13 06:41:09 +0800 )edit

ZK version is 6.5.5

sjoshi ( 2014-01-13 07:03:40 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-01-13 07:08:05 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

updated 2014-01-13 14:43:08 +0800

After a while searching I found also this :

Labels.reset();

in : http://www.zkoss.org/javadoc/6.5.2/zk/org/zkoss/util/resource/Labels.html#reset())

Greetz chill.

link publish delete flag offensive edit

Comments

Sorry dear same issue even i used your code.

sjoshi ( 2014-01-13 07:32:59 +0800 )edit

like I said, not tested but was good for trying. I'll search with you for a solution.

chillworld ( 2014-01-13 07:36:47 +0800 )edit

just tested in mine project and here it does work correct the i18n. (work with 6.5.3), I'll search for more

chillworld ( 2014-01-13 08:27:44 +0800 )edit

Yes this worked we have to use 'Labels.reset();'

sjoshi ( 2014-01-13 09:24:07 +0800 )edit
1

ah nice to hear. Happy coding further.

chillworld ( 2014-01-13 09:34:49 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-01-13 06:37:18 +0800

Seen: 21 times

Last updated: Jan 13 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More