-
Notifications
You must be signed in to change notification settings - Fork 182
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
Implement and re-implement auxiliary keys #3632
Comments
What separator should we use?
Competing priorities: a) Locale sort should be the same as string sort (@sffc)
Options on the table:
|
For future discussion (before 1.3): It occurred to me that another repr could be |
Reopening to finalize the discussion above |
Follow-up for datagen filtering: #3907 |
Conclusion: implement the LGTM: @sffc @Manishearth @skius |
Thought: we should doc-hide auxiliary keys in 1.3, everything that uses them is experimental and we should also consider them experimental |
I have the Given this change, and given that no one has every been super happy with the |
Discussion:
LGTM: @sffc @Manishearth @robertbastian |
We still have #3632 open to continue bikeshedding on API design.
The changes to auxiliary keys can be done now, as they're experimental, I could get started on those. Unless @sffc is working on it, as he's assigned? |
I did the original implementation of AuxiliaryKeys. You're welcome to take the implementation of DataKeyAttributes. |
In preparation for #3632 There are two cases: * `DataLocales` that are passed into ICU4X constructors: * These are constructed with `locale!("foo").into()`, or `"foo".parse()` * When changing a constructor to preferences, the code doesn't need to be changed if we add a `From<Locale>` impl for the preferences * `DataLocales` that are put into the `DataRequest::locale` field. * These are constructed with `langid!("foo").into()`, or `"foo".parse()` * When changing the field to `&LanguageIdentifier`, these can be clippy-cleaned-up, as the `.into()` will become redundant. I've taken care to avoid having intermediate `Locale` or `LanguageIdentifier` variables, everything that is macro-constructed is immediately `into()`ed. This will simplify find-and-replace later.
Actually due to features, this is quite messy. Currently this is all controlled by the |
Would |
Display names might need to load "en-GB" which is two subtags and requires making a string to glue them into &str. Which might be fine Datetime might have combinations for date and time like ym0d-jms Hmmm, &dyn Writeable? (but we don't like trait objects) Or how about just &[Subtag] |
I'd prefer using |
|
|
I don't see what the repetition gains us? Having a slice costs 16 bytes. |
The "repetition" (tinystr slice) allows us to represent concepts such as I'm not 100% convinced which one is better. Just laying out the facts. |
Both |
The data representation is a different discussion from the API representation though. |
If we end up using something tinystr-based, it would be nice (and required for performance) to make it in the API, and we might want to remove the string constructors form the API. |
#3632 --------- Co-authored-by: Shane F. Carr <shane@unicode.org>
Conclusion: pub struct DataMarkerAttributes {
// Validated to be non-empty ASCII alphanumeric + hyphen
value: str,
}
LGTM: @sffc @robertbastian |
The model for auxiliary keys is discussed in #1441. We need it for at least two components (currency and display names, #3260).
The text was updated successfully, but these errors were encountered: