You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carl-Eric Menzel (Created) (JIRA)" <ji...@apache.org> on 2011/10/01 17:41:34 UTC
[jira] [Created] (WICKET-4102) AutoLabelTextResolver fails to pick
up locale changes in the session
AutoLabelTextResolver fails to pick up locale changes in the session
--------------------------------------------------------------------
Key: WICKET-4102
URL: https://issues.apache.org/jira/browse/WICKET-4102
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.5.1
Reporter: Carl-Eric Menzel
When using <wicket:label key="..."> AutoLabelTextResolver correctly picks up the localized message identified by the key. However, if the Session locale is changed, neither the printed label nor the FormComponent's label model get updated - both will still contain the initial message. This is inconsistent with the behavior of <wicket:message> and StringResourceModel. The principle of least surprise (and in my opinion, also that of highest usefulness ;-) ) suggests that AutoLabelTextResolver should dynamically get the localized string whenever it deals with something that can be localized. That includes the <wicket:label key="..."> case mentioned above, as well as when using FormComponent#getDefaultLabel.
I have only tested this in trunk 1.5 (since it recently came up during a training I gave on Wicket 1.5). I suspect it also affects 1.4.x.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-4102) AutoLabelTextResolver fails to pick
up locale changes in the session
Posted by "Carl-Eric Menzel (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carl-Eric Menzel updated WICKET-4102:
-------------------------------------
Attachment: 0001-WICKET-4102-Make-sure-AutoLabelTextResolver-can-foll.patch
This patch against trunk contains:
- a test that demonstrates the wrong behavior of AutoLabelTextResolver
- a fixed AutoLabelTextResolver that behaves correctly.
To fix the issue, I changed AutoLabelTextResolver to use a StringResourceModel when picking up a localized message via the key attribute. When it's using FormComponent#getDefaultLabel it now uses a LoadableDetachableModel to reliably pick up changes here. I also refactored the "find the label content" part of AutoLabelTextResolver#onComponentTag into a separate method to increase readability.
> AutoLabelTextResolver fails to pick up locale changes in the session
> --------------------------------------------------------------------
>
> Key: WICKET-4102
> URL: https://issues.apache.org/jira/browse/WICKET-4102
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.1
> Reporter: Carl-Eric Menzel
> Attachments: 0001-WICKET-4102-Make-sure-AutoLabelTextResolver-can-foll.patch
>
>
> When using <wicket:label key="..."> AutoLabelTextResolver correctly picks up the localized message identified by the key. However, if the Session locale is changed, neither the printed label nor the FormComponent's label model get updated - both will still contain the initial message. This is inconsistent with the behavior of <wicket:message> and StringResourceModel. The principle of least surprise (and in my opinion, also that of highest usefulness ;-) ) suggests that AutoLabelTextResolver should dynamically get the localized string whenever it deals with something that can be localized. That includes the <wicket:label key="..."> case mentioned above, as well as when using FormComponent#getDefaultLabel.
> I have only tested this in trunk 1.5 (since it recently came up during a training I gave on Wicket 1.5). I suspect it also affects 1.4.x.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (WICKET-4102) AutoLabelTextResolver fails to pick
up locale changes in the session
Posted by "Igor Vaynberg (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg reassigned WICKET-4102:
-------------------------------------
Assignee: Igor Vaynberg
> AutoLabelTextResolver fails to pick up locale changes in the session
> --------------------------------------------------------------------
>
> Key: WICKET-4102
> URL: https://issues.apache.org/jira/browse/WICKET-4102
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.1
> Reporter: Carl-Eric Menzel
> Assignee: Igor Vaynberg
> Attachments: 0001-WICKET-4102-Make-sure-AutoLabelTextResolver-can-foll.patch
>
>
> When using <wicket:label key="..."> AutoLabelTextResolver correctly picks up the localized message identified by the key. However, if the Session locale is changed, neither the printed label nor the FormComponent's label model get updated - both will still contain the initial message. This is inconsistent with the behavior of <wicket:message> and StringResourceModel. The principle of least surprise (and in my opinion, also that of highest usefulness ;-) ) suggests that AutoLabelTextResolver should dynamically get the localized string whenever it deals with something that can be localized. That includes the <wicket:label key="..."> case mentioned above, as well as when using FormComponent#getDefaultLabel.
> I have only tested this in trunk 1.5 (since it recently came up during a training I gave on Wicket 1.5). I suspect it also affects 1.4.x.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (WICKET-4102) AutoLabelTextResolver fails to pick
up locale changes in the session
Posted by "Igor Vaynberg (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-4102.
-----------------------------------
Resolution: Fixed
Fix Version/s: 1.5.2
> AutoLabelTextResolver fails to pick up locale changes in the session
> --------------------------------------------------------------------
>
> Key: WICKET-4102
> URL: https://issues.apache.org/jira/browse/WICKET-4102
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.1
> Reporter: Carl-Eric Menzel
> Assignee: Igor Vaynberg
> Fix For: 1.5.2
>
> Attachments: 0001-WICKET-4102-Make-sure-AutoLabelTextResolver-can-foll.patch
>
>
> When using <wicket:label key="..."> AutoLabelTextResolver correctly picks up the localized message identified by the key. However, if the Session locale is changed, neither the printed label nor the FormComponent's label model get updated - both will still contain the initial message. This is inconsistent with the behavior of <wicket:message> and StringResourceModel. The principle of least surprise (and in my opinion, also that of highest usefulness ;-) ) suggests that AutoLabelTextResolver should dynamically get the localized string whenever it deals with something that can be localized. That includes the <wicket:label key="..."> case mentioned above, as well as when using FormComponent#getDefaultLabel.
> I have only tested this in trunk 1.5 (since it recently came up during a training I gave on Wicket 1.5). I suspect it also affects 1.4.x.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira