Skip to content

Commit d11605e

Browse files
committed
Fix CLDRFile usage in GenerateMissingAnnotations.java
1 parent 1fdad4b commit d11605e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

unicodetools/src/main/java/org/unicode/tools/emoji/GenerateMissingAnnotations.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.unicode.cldr.util.Counter;
3030
import org.unicode.cldr.util.Factory;
3131
import org.unicode.cldr.util.Level;
32+
import org.unicode.cldr.util.NameGetter;
3233
import org.unicode.cldr.util.Organization;
3334
import org.unicode.cldr.util.StandardCodes;
3435
import org.unicode.cldr.util.With;
@@ -195,6 +196,7 @@ private static void generateMissing() throws IOException {
195196
}
196197
}
197198

199+
NameGetter nameGetter = config.getEnglish().nameGetter();
198200
Set<String> skipped = new LinkedHashSet<>();
199201
Map<String, Counts> countMap = new TreeMap<>();
200202
Counts totals = new Counts();
@@ -214,7 +216,7 @@ private static void generateMissing() throws IOException {
214216
Counts counts = new Counts();
215217
final String fileName = s + ".tsv";
216218
try (PrintWriter out = FileUtilities.openUTF8Writer(annotationDir, fileName)) {
217-
System.out.println(s + "\t" + config.getEnglish().getName(s));
219+
System.out.println(s + "\t" + nameGetter.getNameFromIdentifier(s));
218220
doAnnotations(s, out, SORTED_EMOJI, counts);
219221
}
220222
if (counts.isEmpty()) {
@@ -230,13 +232,13 @@ private static void generateMissing() throws IOException {
230232
"Skipping "
231233
+ skip
232234
+ " ("
233-
+ config.getEnglish().getName(skip)
235+
+ nameGetter.getNameFromIdentifier(skip)
234236
+ "), no current CLDR annotation data");
235237
}
236238
for (Entry<String, Counts> entry : countMap.entrySet()) {
237239
String locale = entry.getKey();
238240
System.out.println(
239-
locale + "\t" + config.getEnglish().getName(locale) + "\t" + entry.getValue());
241+
locale + "\t" + nameGetter.getNameFromIdentifier(locale) + "\t" + entry.getValue());
240242
}
241243
System.out.println("Totals:\t\t" + totals);
242244
}

0 commit comments

Comments
 (0)