Localization of PageParameters

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Localization of PageParameters

Ravi
Hi guys,

we stumbled on a behavior and I'm not sure why it is implemented as it is ;)

It concerns the reading of PageParameters. They all use the StringValue constructor without passing the Session locale.
The StringValue will in turn use the systems locale.

So when I retrieve a _en formatted number (1.000) from my GET-Params, I get a wrong number (1) because my Server runs on a _de machine where a dot is a decimal delimeter.

I can work around that by again creating a StringValue based on my previous StringValue, but with passing the Session locale.

Shouldn't it pass the session's locale in first place?

See here for the PageParameter implementation and here for the StringValue implementation.

Thank you for taking the time,

Ravi
Reply | Threaded
Open this post in threaded view
|

Re: Localization of PageParameters

Martin Grigorov-4
Hi,

I think this is a reasonable improvement.
Since it changes the behavior we can do it only in 8.x (before 8.0.0).
Please create a ticket and if no one objects we will make the change!

Thank you!

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

On Tue, Jul 11, 2017 at 1:41 PM, Ravi <[hidden email]> wrote:

> Hi guys,
>
> we stumbled on a behavior and I'm not sure why it is implemented as it is
> ;)
>
> It concerns the reading of PageParameters. They all use the StringValue
> constructor without passing the Session locale.
> The StringValue will in turn use the systems locale.
>
> So when I retrieve a _en formatted number (1.000) from my GET-Params, I get
> a wrong number (1) because my Server runs on a _de machine where a dot is a
> decimal delimeter.
>
> I can work around that by again creating a StringValue based on my previous
> StringValue, but with passing the Session locale.
>
> Shouldn't it pass the session's locale in first place?
>
> See  here
> <https://github.com/apache/wicket/blob/master/wicket-
> request/src/main/java/org/apache/wicket/request/mapper/
> parameter/PageParameters.java#L167>
> for the PageParameter implementation and  here
> <https://github.com/apache/wicket/blob/master/wicket-
> util/src/main/java/org/apache/wicket/util/string/StringValue.java#L186>
> for the StringValue implementation.
>
> Thank you for taking the time,
>
> Ravi
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Localization-of-PageParameters-tp4678221.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Localization of PageParameters

Ravi
Hi Martin,

here's the Ticket https://issues.apache.org/jira/browse/WICKET-6419

Thank you!