You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/08/07 13:10:12 UTC

[jira] [Commented] (WICKET-5668) StringResourceModel with custom locale

    [ https://issues.apache.org/jira/browse/WICKET-5668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14089130#comment-14089130 ] 

ASF subversion and git services commented on WICKET-5668:
---------------------------------------------------------

Commit ec4775541046acbf6de0e26fef9cbd3c5efb4f0e in wicket's branch refs/heads/wicket-1.5.x from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=ec47755 ]

WICKET-5668 StringResourceModel with custom locale

(cherry picked from commit 98404f5541fee8064ff01dee7ff7f4209669245c)


> StringResourceModel with custom locale 
> ---------------------------------------
>
>                 Key: WICKET-5668
>                 URL: https://issues.apache.org/jira/browse/WICKET-5668
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5.11
>            Reporter: Marek Martinkovič
>            Priority: Minor
>             Fix For: 1.5.12, 7.0.0-M3, 6.17.0
>
>
> Hi. 
> I recently ran into problem with usage StringResourceModel class in 
> my application logic.
> I need to grab value from StringResourceModel.  And that value must be message for diferent locale than stored in session or inserted in component.
> example:
> lets have 
> s= new StringResourceModel(key, component, model, args); 
> session locale : en
> component locale : en_UK
> I need message for : sk_SK 
> i need something like 
> s= new StringResourceModel(key, component, model, args); 
> s.setLocale(/*sk_SK*/);
> I propose
> Introduce property "locale" . internally will have top priority in load() function, if is not set, it will pass next rule, witch is component and session. 
> if (customLocale != null)
> {
>                 locale= cusomLocale;
> } 
> else 
> {
>                 if (component != null)
> 		{
> 			locale = component.getLocale();
> 		}
> 		else
> 		{
> 			locale = Session.exists() ? Session.get().getLocale() : Locale.getDefault();
> 		}
> }
> Thank for consideration. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)