You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/08/07 13:10:12 UTC
[jira] [Resolved] (WICKET-5668) StringResourceModel with custom
locale
[ https://issues.apache.org/jira/browse/WICKET-5668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-5668.
-------------------------------------
Resolution: Fixed
Fix Version/s: 6.17.0
7.0.0-M3
1.5.12
Assignee: Martin Grigorov
Added overridable #getLocale().
> 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č
> Assignee: Martin Grigorov
> 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)