Hi,
#getSttring() will lookup the value for the i18n bundle *once* and then the
value (a String) will be stored in the Model.
To make it dynamic you should use ResourceModel("the.i18n.key"). This model
will load the value every thing you ask it by taking into account the
content (locale, style, variation).
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Mon, Dec 18, 2017 at 11:29 PM, extraquoo <[email protected]> wrote:
> Hi,
>
> I am facing an i18n for a yes/no radio button listener in a Border class
> when doing locale switch.
>
> here is some piece of orginal codes
>
> // Lets other elements register yes/no selections listeners
> listeners = new ArrayList<IYesNoChangeListener>();
>
> // The button elements for yes & no are constructed and
> added here
> ArrayList<ButtonElement<YesNo>> buttonList = new
> ArrayList<ButtonElement<YesNo>>();
> buttonList.add(yes = new ButtonElement<YesNo>(
> new Model<YesNo>(YesNo.Y), new
> Model<String>("Yes")));
> buttonList.add(yes = new ButtonElement<YesNo>(
> new Model<YesNo>(YesNo.N), new
> Model<String>("No")));
> yesNoGroup = new ButtonRadioSet<YesNo>("yesNoGroup",
> Model.ofList(buttonList), questionAnswer);
>
>
> in the corresponding html,
>
> <body>
> <wicket:border>
>
>
>
>
> * <label
> wicket:id="question">Question
> text</label>*
>
>
>
>
> <div wicket:id="bodyWrapper">
> <wicket:body />
> </div>
> </wicket:border>
> </body>
>
> -------------------------------------
> I am trying to use GetString() method to replace the "YES","NO" in model
> attribute and create key-value pairs in the xml files (xxx_es.xml,
> xxx_zh.xml) for different languages. However, since it is controller tier,
> when I change the locale, it won't touch the class to execute border
> initialization.
> I find the tag <wicket:message> works perfectly for i18n. Is there any
> similar way in wicket framework that can solve the i18n for
> ButtonRadioSet/ButtonElement in border component?
>
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-
> f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>