You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by try0 <gi...@git.apache.org> on 2018/02/12 11:29:11 UTC
[GitHub] wicket pull request #267: Fix to use locale of the session
GitHub user try0 opened a pull request:
https://github.com/apache/wicket/pull/267
Fix to use locale of the session
Fix to output validation message according to locale even when format pattern contains "E".
Sorry if my English is wrong.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/try0/wicket modifyDateValidator
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/267.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #267
----
commit b822c30fd6271b654db7a08716c5e5034b5e752a
Author: Ryo <tr...@...>
Date: 2018-02-12T10:10:50Z
Fixed to use locale of the session
Fixed to output validation message according to locale when format pattern contains "E".
commit af5a25585be06c3c7c93c951c9415d015f4e670c
Author: Ryo <tr...@...>
Date: 2018-02-12T10:46:32Z
Revert "Fixed to use locale of the session"
This reverts commit b822c30fd6271b654db7a08716c5e5034b5e752a.
commit b3aad1921db7e367e0174ab03672c84cc4a6827d
Author: Ryo <tr...@...>
Date: 2018-02-12T10:48:38Z
Fixed to use locale of the session
Fixed to output validation message according to locale when format pattern contains "E".
----
---
[GitHub] wicket pull request #267: Fix to use locale of the session
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on a diff in the pull request:
https://github.com/apache/wicket/pull/267#discussion_r167540897
--- Diff: wicket-core/src/main/java/org/apache/wicket/validation/validator/DateValidator.java ---
@@ -186,7 +188,15 @@ protected IValidationError decorate(IValidationError error, IValidatable<Date> v
// format variables if format has been specified
if (format != null)
{
- SimpleDateFormat sdf = new SimpleDateFormat(format);
+ WebSession session = WebSession.get();
--- End diff --
There is no need of `Web`Session. Just `Session.get()` should be enough to get the locale.
---
[GitHub] wicket issue #267: Fix to use locale of the session
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/267
Hi @try0
The fix is integrated, now:
master - https://github.com/apache/wicket/commit/6c91b495738c597a9c89f624d6f675cd6eb1f609
wicket-7.x - https://github.com/apache/wicket/commit/7ba197c68508f2e15abf5e4bdda046cd4fa14087
Would you be so kind and close this PR?
kind regards and thanks.
---
[GitHub] wicket issue #267: Fix to use locale of the session
Posted by try0 <gi...@git.apache.org>.
Github user try0 commented on the issue:
https://github.com/apache/wicket/pull/267
Thank you very much for the review.
I fixed to check if session exists and changed WebSession to Session.
---
[GitHub] wicket pull request #267: Fix to use locale of the session
Posted by try0 <gi...@git.apache.org>.
Github user try0 closed the pull request at:
https://github.com/apache/wicket/pull/267
---
[GitHub] wicket issue #267: Fix to use locale of the session
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:
https://github.com/apache/wicket/pull/267
Thank you, @try0 !
---
[GitHub] wicket issue #267: Fix to use locale of the session
Posted by try0 <gi...@git.apache.org>.
Github user try0 commented on the issue:
https://github.com/apache/wicket/pull/267
@martin-g
Thank you so much.
You’re welcome.
---
[GitHub] wicket pull request #267: Fix to use locale of the session
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on a diff in the pull request:
https://github.com/apache/wicket/pull/267#discussion_r167540776
--- Diff: wicket-core/src/main/java/org/apache/wicket/validation/validator/DateValidator.java ---
@@ -186,7 +188,15 @@ protected IValidationError decorate(IValidationError error, IValidatable<Date> v
// format variables if format has been specified
if (format != null)
{
- SimpleDateFormat sdf = new SimpleDateFormat(format);
+ WebSession session = WebSession.get();
--- End diff --
First check that there is a Session with `if (Session.exists()) { ... }` because `Session.get()` will create a new one.
---
[GitHub] wicket issue #267: Fix to use locale of the session
Posted by try0 <gi...@git.apache.org>.
Github user try0 commented on the issue:
https://github.com/apache/wicket/pull/267
Hi klopfdreh
Thank you for integrating.
Okay, I see.
I'm happy to have been able to contribute to Wicket.
---