-
Notifications
You must be signed in to change notification settings - Fork 176
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
Locale of constructed object & language negotiation in data loading #173
Comments
In Fluent and Mozilla we use the following lists:
For ICU4X the interesting question is about So, the negotiation needs to know what components are you asking for: let resolved = DataProvider::negotiateLocales(requested, &[Component::PluralRules, Component::NumberFormat]); and then we need to know whether the user wants to only get locales supported by all requested components (or data chunks), or the best available per component. Let's say we have The answer in this example may feel natural to go for more accuracy, since plural rules are per-language and not per region, but what if we had:
Do we then want the Finally, once we get to the single instance, it may be tempting to say that an instance of a component is in a single locale, so we don't need a fallback chain, but that only works if the component doesn't depend on other components. If |
All great points. Answering the question "what locales do you support?" is really hard. Maybe we should ask ourselves, what is the primary use case for asking that question? Based on my experience, I think the most common reason people ask that question is because they have custom fallback logic in the case when a locale is not supported. However, with pluggable data providers, we give users a more official way to add that fallback logic. What other use cases are we looking at? If we don't have any clear use cases, then we could choose to keep locale negotiation exclusively in the data provider object, and not have any "GetLocale" methods on the constructed objects at all. |
I want to extend the scope of this issue to include a very closely related topic, which we discussed in yesterday's ICU4X meeting. How do we handle language negotiation when performing data loading, particularly when different categories of data support different locales? |
Changing this to |
Posted document in the icu4x-sc / Drop Box |
Action items:
|
ICU has three types of locales for constructed objects (return value of
getLocale()
of NumberFormat, for example):It's a very confusing model, so much so that ICU isn't adding new
getLocale()
methods.What model do we want to adopt in ICU4X?
The text was updated successfully, but these errors were encountered: