From 6938aad8eb3d6b6cbee418facea4505e44e3027a Mon Sep 17 00:00:00 2001 From: btangmu Date: Wed, 19 Jun 2024 10:54:08 -0400 Subject: [PATCH] CLDR-17514 Pages too big: divide Fields -Divide Fields into Fields and Relative --- .../main/java/org/unicode/cldr/util/PathHeader.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/PathHeader.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/PathHeader.java index c9a37ddf49a..0bb98b04850 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/PathHeader.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/PathHeader.java @@ -187,6 +187,7 @@ public enum PageId { Keys(SectionId.Locale_Display_Names), Fields(SectionId.DateTime), + Relative(SectionId.DateTime), Gregorian(SectionId.DateTime), Generic(SectionId.DateTime), Buddhist(SectionId.DateTime), @@ -2243,6 +2244,9 @@ private static String fix(String input, int orderIn) { } private static String adjustPageForPath(String input, String path) { + if ("Fields".equals(input)) { + return getFieldsPageId(path).toString(); + } if ("Length".equals(input)) { return getLengthPageId(path).toString(); } @@ -2255,6 +2259,15 @@ private static String adjustPageForPath(String input, String path) { return input; } + private static PageId getFieldsPageId(String path) { + XPathParts parts = XPathParts.getFrozenInstance(path); + return (parts.containsElement("relative") + || parts.containsElement("relativeTime") + || parts.containsElement("relativePeriod")) + ? PageId.Relative + : PageId.Fields; + } + private static Set METRIC_UNITS = Set.of(UnitConverter.UnitSystem.metric, UnitConverter.UnitSystem.metric_adjacent);