Re: Dynamic localisation

2016-06-30 Thread Martin Grigorov
Hi,

You can use StringResourceModel for this. Check its javadoc.


Or org.apache.wicket.Component#getString(java.lang.String,
org.apache.wicket.model.IModel):
Here is an example that I've seen recently:

Label selectedItemsCount = new Label("selectedItemsCount", new
Model() {
@Override
public String getObject() {
return getString("selected.items.count", new
Model(new Serializable() {
public int getCount() {
return getSelectedItems().size();
}
}));
}
});

In MyApp.properties :
selected.items.count=${count} items


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jun 30, 2016 at 6:38 PM, ChambreNoire  wrote:

> Hello,
>
> I wonder if any of you have encountered a similar problem.
>
> I'd like to be able to replace specific localised terms depending on the
> context (according to a session variable with can change during the session
> life).
>
> So for instance, in certain contexts all occurrences of the word 'user'
> within property bundles would be displayed as 'collaborator'.
>
> I'd like to be able to do this in a configurable manner rather than having
> to define multiple versions of my property bundles depending on this
> context.
>
> Any ideas?
>
> Thanks
>
> CN
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Dynamic localisation

2016-06-30 Thread ChambreNoire
Hello,

I wonder if any of you have encountered a similar problem.

I'd like to be able to replace specific localised terms depending on the
context (according to a session variable with can change during the session
life).

So for instance, in certain contexts all occurrences of the word 'user'
within property bundles would be displayed as 'collaborator'.

I'd like to be able to do this in a configurable manner rather than having
to define multiple versions of my property bundles depending on this
context.

Any ideas?

Thanks

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org