Skip to content

Commit 894a8a4

Browse files
committed
ICU-22928 Don't generate data for concentr/perbillion structure - code
1 parent 109008d commit 894a8a4

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/IcuTextWriter.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ static void writeToFile(
6868
this.icuData = checkNotNull(icuData);
6969
}
7070

71+
// ICU-22781: start section
72+
// TODO: remove once ICU-22781 is resolved
73+
private final static RbPath LOCALE_PER_BILLION = RbPath.of("concentr", "portion-per-1e9");
74+
private final static RbPath SUPLEMENTAL_UNITS = RbPath.of("idValidity", "unit", "regular");
75+
private final static RbValue SUPLEMENTAL_PER_BILLION = RbValue.of("concentr-portion-per-1e9");
76+
// ICU-22781: end section
77+
7178
// TODO: Write a UTF-8 header (see https://unicode-org.atlassian.net/browse/ICU-10197).
7279
private void writeTo(PrintWriter out, List<String> header) {
7380
out.write('\uFEFF');
@@ -93,6 +100,17 @@ private void writeTo(PrintWriter out, List<String> header) {
93100

94101
RbPath lastPath = RbPath.of();
95102
for (RbPath path : icuData.getPaths()) {
103+
// ICU-22781: start section
104+
boolean mightBeSupplemental = false;
105+
if (path.contains(LOCALE_PER_BILLION)) {
106+
// I tried logging here, but it is too noisy.
107+
// About 20 entries (and logging 20 lines) per locale.
108+
continue;
109+
}
110+
if (path.contains(SUPLEMENTAL_UNITS)) {
111+
mightBeSupplemental = true;
112+
}
113+
// ICU-22781: end section
96114
// Close any blocks up to the common path length. Since paths are all distinct, the
97115
// common length should always be shorter than either path. We add 1 since we must also
98116
// account for the implicit root segment.
@@ -101,7 +119,14 @@ private void writeTo(PrintWriter out, List<String> header) {
101119
closeLastPath(commonDepth, out);
102120
// After opening the value will be ready for the next value to be written.
103121
openNextPath(path, out);
104-
valueWasInline = appendValues(icuData.getName(), path, icuData.get(path), out);
122+
List<RbValue> values = icuData.get(path);
123+
// ICU-22781: start section
124+
if (mightBeSupplemental) {
125+
System.out.println("(skipping " + SUPLEMENTAL_PER_BILLION + " until ICU-22781 is fixed)");
126+
values.remove(SUPLEMENTAL_PER_BILLION);
127+
}
128+
// ICU-22781: end section
129+
valueWasInline = appendValues(icuData.getName(), path, values, out);
105130
lastPath = path;
106131
}
107132
closeLastPath(0, out);

0 commit comments

Comments
 (0)