Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
9.3.0, 8.12.0
-
None
-
None
Description
WICKET-5668 states that StringResourceModel has a method getLocale that can be overwritten to provide a custom locale when the messages should be differently localized than the context (Component, Session, default) states.
The method getString only uses the custom locale when parsing the message with MessageFormat but not to retrieve the message from the Localizer. The locale parameter is null there (Lines 439, 445 / wicket9)
In my usecase I use the StringResourceModel without a component but want't to provide a custom locale. Instead the Locale.defaultLocale is used to resolve the ressource.
Solution: use the custom Locale getLocal() as parameter for localizer.getString. (The resolving of the locale is implemented the same way in StringResourceModel.getLocale and Localizer.getStringIgnoreSettings anyway.)
Attachments
Issue Links
- Blocked
-
WICKET-5668 StringResourceModel with custom locale
- Resolved