Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17514 Pages too big: divide Fields #3815

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading