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

Add support for aliases in Gregorian eras #169

Merged
merged 1 commit into from
Jul 5, 2022
Merged

Conversation

movermeyer
Copy link
Collaborator

@movermeyer movermeyer commented Jun 30, 2022

What are you trying to accomplish?

Part of #78. Adding support for aliases within the eras elements.

What approach did you choose and why?

Added specific handling for alias nodes at that specific path.
Then added the path to validate_aliases_only_in_expected_paths so that the list remaining alias locations gets smaller.

What should reviewers focus on?

I didn't add support for aliases at /ldml/dates/calendars/calendar/eras, but they are only present in non-Gregorian calendars, and we don't yet export those.

(I wonder if there's a nice way to change validate_aliases_only_in_expected_paths to also check this assertion 🤔)

The impact of these changes

Three less alias locations to handle.

Testing

...

Checklist

  • I have added a CHANGELOG entry for this change (or determined that it isn't needed)

@movermeyer movermeyer requested a review from dpad46 June 30, 2022 16:22
@@ -83,14 +83,18 @@ def periods

def eras
if calendar
base_path = calendar.path.gsub("/ldml/", "") + "/eras"
base_path = calendar.path.sub(%r{^/ldml/}, "") + "/eras"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tightened up the regex and made it non-global.

@movermeyer movermeyer merged commit 155ef64 into main Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants