Skip to content

Commit

Permalink
CLDR-17514 Pages too big: divide Fields
Browse files Browse the repository at this point in the history
-Divide Fields into Fields and Relative
  • Loading branch information
btangmu committed Jun 19, 2024
1 parent 3147eda commit 6938aad
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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();
}
Expand All @@ -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<UnitConverter.UnitSystem> METRIC_UNITS =
Set.of(UnitConverter.UnitSystem.metric, UnitConverter.UnitSystem.metric_adjacent);

Expand Down

0 comments on commit 6938aad

Please sign in to comment.