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 "jan (JIRA)" <em...@incubator.apache.org> on 2018/02/27 09:43:00 UTC
[jira] [Created] (EMPIREDB-273) Improve multi-region support in
TagEncodingHelper / TextInputControl
jan created EMPIREDB-273:
----------------------------
Summary: 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
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)