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

Handling of horizontal fallbacks #259

Closed
zbraniecki opened this issue Sep 22, 2020 · 3 comments · Fixed by #629
Closed

Handling of horizontal fallbacks #259

zbraniecki opened this issue Sep 22, 2020 · 3 comments · Fixed by #629
Assignees
Labels
C-data-infra Component: provider, datagen, fallback, adapters T-docs-tests Type: Code change outside core library
Milestone

Comments

@zbraniecki
Copy link
Member

While working on the data for DateTimeFormat, we started touching on the topic of fallbacks for missing data fields. Examples from the realm of 0.1 are:

The two drives that are extremes are:

  • We want to make ICU4X DataProvider easy to use. Handling fallbacking in data provider means user doesn't have to worry about missing data and fallback decisions.
  • We want to make ICU4X DataProvider flexible. Being opaque about missing data means that user has no flexibility in choosing how to handle fallbacks (do we always want to fallback from short to long if its missing? Maybe in some scenario user will want to fallback differently?

If we go with fallback in the provider, we're likely going to have to add ability to get data without the fallback. If we go with fallback in hands of consumer, we will need to help consumers know how to fallback and there's going to be a number of repetitive pieces of fallbacking in consumers.

Finally, expanding all data in provider means more data to carry over the wire. A good example is the second one - for locales where stand_alone matches format contexts, we could just carry over format and set stand_alone to null and the consumer then can say "if there is stand_alone, use it, if not, fallback on format".
But if we expand all fallbacks in Provider, we'll have to for all locales carry duplicated data so that user can infallibly take stand_alone.

I believe that, as in most cases, we'll be looking for the "third path" somewhere between those two extremes, and we'll need to resolve it on per-case bases, but I think that encoding in wiki (https://github.com/unicode-org/icu4x/wiki/Hooking-up-a-DataProvider) or docs some guidelines on how to generally make decisions on what is going to be expanded in Provider vs. in consumer, is in our best interest, so let's discuss it!

@zbraniecki
Copy link
Member Author

For DateTime 0.1 needs I'm planning to keep Option on:

  • context stand_alone since for many locales it is the same as format and storing duplicated data would be unnecessary
  • WidthsV1, since not all locales have all widths.

@zbraniecki zbraniecki added the discuss Discuss at a future ICU4X-SC meeting label Sep 24, 2020
@sffc sffc added the C-data-infra Component: provider, datagen, fallback, adapters label Oct 20, 2020
@sffc sffc added this to the 2020 Q4 milestone Oct 22, 2020
@sffc sffc removed their assignment Nov 19, 2020
@sffc sffc changed the title Handling of fallbacks Handling of horizontal fallbacks Nov 19, 2020
@sffc sffc added T-docs-tests Type: Code change outside core library and removed discuss Discuss at a future ICU4X-SC meeting labels Dec 4, 2020
@sffc sffc modified the milestones: 2020 Q4, 2021-Q1-m1 Jan 7, 2021
@mihnita mihnita modified the milestones: 2021-Q1-m1, 2021-Q1-m2 Feb 4, 2021
@sffc sffc modified the milestones: 2021-Q1-m2, ICU4X 0.2 Mar 12, 2021
@mihnita
Copy link
Contributor

mihnita commented Mar 30, 2021

short width month name
There is no such thing, even for English.
We have wide ("December") abbreviated ("Dec") and narrow ("D")

Does not change the need to address it. Just making sure the description / examples are accurate.

@mihnita
Copy link
Contributor

mihnita commented Mar 30, 2021

Shared https://docs.google.com/document/d/19iJb3NSmy0frue3zBmHMibTg2PCgkRCRKNnqQhMfy4Y/
Will convert to .md after the first "weaves" of comments, if that's OK with you?
(but if you want it "right now", I can also do that)

@sffc sffc added the discuss Discuss at a future ICU4X-SC meeting label Apr 1, 2021
@sffc sffc removed the discuss Discuss at a future ICU4X-SC meeting label Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-data-infra Component: provider, datagen, fallback, adapters T-docs-tests Type: Code change outside core library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants