This is my attempt at fixing #13152. http://bugs.icu-project.org/trac/ticket/13152 Previously, places that needed a locale to ...
6 years, 10 months ago
(2017-06-23 08:57:56 UTC)
#1
This is my attempt at fixing #13152.
http://bugs.icu-project.org/trac/ticket/13152
Previously, places that needed a locale to load data used the one from
DecimalFormatSymbols. However, people said that the data locale should be
independent from DecimalFormatSymbols.
My approach to fix the problem is to add a ULocale to the property bag and use
that locale instead of the one from the symbols.
Notes:
1) The solution is borderline of feeling like a hack. I had to go through
everywhere in the code and make sure that the property bag was always being
populated with the dataLocale. The property bag was intended for "non-critical"
properties (if they're missing, things still work), but the data locale is a
"critical" property (if it's missing, things crash).
2) There are a few places left that still use the DecimalFormatSymbols locale;
they are all related to currency symbols (get the locale's symbols for a given
currency). I wasn't sure whether or not I should switch these over to the new
data locale.
Thoughts?
https://codereview.appspot.com/328770043/diff/1/icu4j/main/classes/core/src/c...
File icu4j/main/classes/core/src/com/ibm/icu/impl/number/Endpoint.java (right):
https://codereview.appspot.com/328770043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/Endpoint.java:297: assert
uLocale != null;
This assertion is the one that brought to my attention all of the various places
where dataLocale wasn't being set.
I should probably move it up into the main method.
LGTM https://codereview.appspot.com/328770043/diff/1/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java File icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java (right): https://codereview.appspot.com/328770043/diff/1/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java#newcode302 icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java:302: properties.setDataLocale(symbols.getULocale()); Could also use "def" that was just ...
6 years, 10 months ago
(2017-06-26 21:50:36 UTC)
#2
Issue 328770043: ticket:13152 Adding 'dataLocale' property so that data can come from a different source than the Sy…
Created 6 years, 10 months ago by sffc
Modified 6 years, 9 months ago
Reviewers: andy.heninger
Base URL: svn+icussh://source.icu-project.org/repos/icu/trunk/
Comments: 3