You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Rainer Döbele (JIRA)" <em...@incubator.apache.org> on 2018/10/19 08:43:00 UTC

[jira] [Resolved] (EMPIREDB-273) Improve multi-region support in TagEncodingHelper / TextInputControl

     [ https://issues.apache.org/jira/browse/EMPIREDB-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rainer Döbele resolved EMPIREDB-273.
------------------------------------
       Resolution: Fixed
         Assignee: Rainer Döbele
    Fix Version/s: empire-db-2.4.7

Removed final form ResourceTextResolver.getLocale()

> Improve multi-region support in TagEncodingHelper / TextInputControl
> --------------------------------------------------------------------
>
>                 Key: EMPIREDB-273
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-273
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: JSF2 Extensions
>    Affects Versions: empire-db-2.4.6
>            Reporter: jan
>            Assignee: Rainer Döbele
>            Priority: Minor
>             Fix For: empire-db-2.4.7
>
>
> An InputControl can access the current Locale via ValueInfo.getLocale(). ValueInfoImpl is using the ResourceTextResolver.getLocale() method, which uses the locale of the ResourceBundle. The Initialisiation of the TextReslver/ResourceBundle is done in WebApplication.initTextResolvers(...).
> Problem: if you use a Locale with a region, e. g. de_CH, the region gets lost when loading the ResourceBundle via ResourceBundle.getBundle(messageBundle, locale) (WebApplication.java, line 374).
> Because of the missing region, TextInputControl.formatValue(..)-method is using the default "DE" locale instead of de_CH. That results in the wrong decimalformat (1.000,00 instead of 1'000.00).
> My workyround is to use my own TextResolver (which keeps the real locale) and override initTextResolvers in my application class. IMO that should not be necessary. At least getLocale in ResourceTextResolver should not be final so it can be overwritten.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)