-
Notifications
You must be signed in to change notification settings - Fork 184
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
Design Doc: Vertical Fallback in Data Loading #1462
Conversation
CC @richgillam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented on this in the ICU-TC meeting yesterday, and I don't really have anything new to say. I wanted to reread this document to make sure I didn't miss anything, and I think I understand what you're proposing a lot better now that I've read it a second time, and I think I like what you're doing here.
As I mentioned, I'm interested in seeing what you do about horizontal inheritance, but I know that's a separate problem...
|
||
Vertical fallbacking should follow a tree: every locale should have exactly one parent, except the root locale, which has no parent. | ||
|
||
In the absence of overrides, a locale's parent is the locale with one subtag removed from the end of a locale: `pr-Latn-PT` → `pt-Latn` → `pt` → `und`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "pt-Latn-PT".
**Cons:** | ||
|
||
- Requires shipping the likely subtags code and data | ||
- All lookups incur a small but nonempty penalty when maximization occurs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I said my piece in the ICU-TC meeting the other day, but I think I vote for Option 3, with a provision to fall back to Option 2 for implementations that know their locale data doesn't need it and don't want to incur the space penalty for the likely-subtags tables.
- Footgun: If a non-minimized locale is passed at runtime, it could have the incorrect behavior. For example, `sr-Latn-ME` or `de-Latn-LI` may not find the correct data. | ||
- Struggles to scale when there are many data keys | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These cons sound disqualifying to me.
Thank you @richgillam for your review! This is a friendly ping to all my other reviewers:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all seems reasonable to me. I agree with Rich's comment, option 3, with a way to disable maximization for users that don't want it seems like a good way ahead.
I will prepare an update to this PR within the next week and then re-request review. |
This PR is obsolete so I will close it and replace it with a new one later. |
Fixes #1203
I've been promising a design doc for the vertical fallback implementation, a follow-up to Mihai's doc from earlier in the quarter about the theory.
The doc assumes that the reader is already familiar with the subject matter; I do not spend much time clarifying basic concepts.
In the doc, I state some claims and assumptions. At the end, I lay out four possible implementation approaches:
I claim that all of these approaches achieve the same end result, but with their own caveats. I'd appreciate feedback on these four approaches, but try to keep feedback on the technical merits.