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

Change content_locale to be &LanguageIdentifier #5566

Merged
merged 5 commits into from
Oct 8, 2024

Conversation

sffc
Copy link
Member

@sffc sffc commented Sep 20, 2024

This keeps the options bags Copy.

I also switched to LanguageIdentifier which is a more public-facing, stable type. We're trying to phase out DataLocale in public-facing APIs (#419).

Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

Not a fan of lifetimes on options bags but I do think this is better.

I could be wrong but I recall us having a long discussion about this years ago and coming to a conclusion. I believe the conclusion was to borrow owned types in options bags but worth seeing if we can find and document it somewhere.

@sffc
Copy link
Member Author

sffc commented Sep 20, 2024

Issue: #3713

PR implementing it and adding it to the graduation checklist: #4757

We gave ourselves the flexibility to make case-by-case exceptions. Personally I think this one is better as a borrow, because it is only needed during construction: we don't need to save the value for longer.

@Manishearth
Copy link
Member

Yep, I don't see any strong justification for this to not be Copy.

@Manishearth
Copy link
Member

Looks like dart bindings generation has broken? Dart update? cc @robertbastian

I support bypassing test-dart and merging this (and other open PRs that don't touch ffi)

@sffc
Copy link
Member Author

sffc commented Sep 23, 2024

@aethanyc @makotokato Any feedback?

Manishearth
Manishearth previously approved these changes Sep 23, 2024
aethanyc
aethanyc previously approved these changes Sep 28, 2024
Copy link
Contributor

@aethanyc aethanyc left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. This PR looks good to me.

@sffc sffc dismissed stale reviews from aethanyc and Manishearth via 5ef64cf September 29, 2024 04:42
aethanyc
aethanyc previously approved these changes Sep 30, 2024
@@ -2,8 +2,10 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).


Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this blank line is not needed.

use icu_locale_core::langid;
use icu_properties::PropertyNames;
use icu_properties::PropertyNamesLong;

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this blank line is not needed.

Copy link
Contributor

@aethanyc aethanyc left a comment

Choose a reason for hiding this comment

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

Thanks!

@makotokato
Copy link
Member

Currently, segmenter doesn't require country and etc, so it is OK.

@sffc sffc merged commit 0bf22da into unicode-org:main Oct 8, 2024
28 checks passed
@sffc sffc deleted the content-langid branch October 8, 2024 11:24
@sffc
Copy link
Member Author

sffc commented Oct 8, 2024

Currently, segmenter doesn't require country and etc, so it is OK.

Region is still part of the LanguageIdentifier.

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.

4 participants