8329787: Fix typo in CLDRConverter
Reviewed-by: jlu, iris, lancea, bpb
This commit is contained in:
parent
115f4193eb
commit
dd930c573b
@ -97,7 +97,7 @@ public class CLDRConverter {
|
|||||||
private static final String DST = "dst";
|
private static final String DST = "dst";
|
||||||
private static final String NO_SUBST = "-";
|
private static final String NO_SUBST = "-";
|
||||||
|
|
||||||
private static SupplementDataParseHandler handlerSuppl;
|
private static SupplementalDataParseHandler handlerSuppl;
|
||||||
private static LikelySubtagsParseHandler handlerLikelySubtags;
|
private static LikelySubtagsParseHandler handlerLikelySubtags;
|
||||||
private static WinZonesParseHandler handlerWinZones;
|
private static WinZonesParseHandler handlerWinZones;
|
||||||
static PluralsParseHandler handlerPlurals;
|
static PluralsParseHandler handlerPlurals;
|
||||||
@ -471,7 +471,7 @@ public class CLDRConverter {
|
|||||||
// SupplementalData file also provides the "parent" locales which
|
// SupplementalData file also provides the "parent" locales which
|
||||||
// are othrwise not to be fallen back. Process them here as well.
|
// are othrwise not to be fallen back. Process them here as well.
|
||||||
//
|
//
|
||||||
handlerSuppl = new SupplementDataParseHandler();
|
handlerSuppl = new SupplementalDataParseHandler();
|
||||||
parseLDMLFile(new File(SPPL_SOURCE_FILE), handlerSuppl);
|
parseLDMLFile(new File(SPPL_SOURCE_FILE), handlerSuppl);
|
||||||
Map<String, Object> parentData = handlerSuppl.getData("root");
|
Map<String, Object> parentData = handlerSuppl.getData("root");
|
||||||
parentData.keySet().stream()
|
parentData.keySet().stream()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -38,11 +38,11 @@ import org.xml.sax.InputSource;
|
|||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles parsing of files in Locale Data Markup Language for SupplementData.xml
|
* Handles parsing of files in Locale Data Markup Language for supplementalData.xml
|
||||||
* and produces a map that uses the keys and values of JRE locale data.
|
* and produces a map that uses the keys and values of JRE locale data.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
class SupplementalDataParseHandler extends AbstractLDMLHandler<Object> {
|
||||||
//UNM49 region and composition code used in supplementalData.xml
|
//UNM49 region and composition code used in supplementalData.xml
|
||||||
private static final String WORLD = "001";
|
private static final String WORLD = "001";
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
|||||||
// "component" specific to this parent locale chain
|
// "component" specific to this parent locale chain
|
||||||
private String currentParentLocaleComponent;
|
private String currentParentLocaleComponent;
|
||||||
|
|
||||||
SupplementDataParseHandler() {
|
SupplementalDataParseHandler() {
|
||||||
firstDayMap = new HashMap<>();
|
firstDayMap = new HashMap<>();
|
||||||
minDaysMap = new HashMap<>();
|
minDaysMap = new HashMap<>();
|
||||||
parentLocalesMap = new HashMap<>();
|
parentLocalesMap = new HashMap<>();
|
||||||
@ -132,32 +132,15 @@ class SupplementDataParseHandler extends AbstractLDMLHandler<Object> {
|
|||||||
switch (qName) {
|
switch (qName) {
|
||||||
case "firstDay":
|
case "firstDay":
|
||||||
if (!isIgnored(attributes)) {
|
if (!isIgnored(attributes)) {
|
||||||
String fd;
|
String fd = switch (attributes.getValue("day")) {
|
||||||
|
case "sun" -> "1";
|
||||||
switch (attributes.getValue("day")) {
|
case "tue" -> "3";
|
||||||
case "sun":
|
case "wed" -> "4";
|
||||||
fd = "1";
|
case "thu" -> "5";
|
||||||
break;
|
case "fri" -> "6";
|
||||||
default:
|
case "sat" -> "7";
|
||||||
case "mon":
|
default -> "2"; // Mon
|
||||||
fd = "2";
|
};
|
||||||
break;
|
|
||||||
case "tue":
|
|
||||||
fd = "3";
|
|
||||||
break;
|
|
||||||
case "wed":
|
|
||||||
fd = "4";
|
|
||||||
break;
|
|
||||||
case "thu":
|
|
||||||
fd = "5";
|
|
||||||
break;
|
|
||||||
case "fri":
|
|
||||||
fd = "6";
|
|
||||||
break;
|
|
||||||
case "sat":
|
|
||||||
fd = "7";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
firstDayMap.put(attributes.getValue("territories"), fd);
|
firstDayMap.put(attributes.getValue("territories"), fd);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -36,7 +36,7 @@ import org.xml.sax.SAXException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles parsing of files in Locale Data Markup Language for
|
* Handles parsing of files in Locale Data Markup Language for
|
||||||
* SupplementalMetadata.xml
|
* supplementalMetadata.xml
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SupplementalMetadataParseHandler extends AbstractLDMLHandler<Object> {
|
class SupplementalMetadataParseHandler extends AbstractLDMLHandler<Object> {
|
||||||
|
Loading…
Reference in New Issue
Block a user