-
Notifications
You must be signed in to change notification settings - Fork 174
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
Add references to LocaleCanonicalizer #5306
base: main
Are you sure you want to change the base?
Conversation
components/locale_core/src/langid.rs
Outdated
@@ -27,7 +27,8 @@ use writeable::Writeable; | |||
/// `_` separators to `-` and adjusting casing to conform to the Unicode standard. | |||
/// | |||
/// Any bogus subtags will cause the parsing to fail with an error. | |||
/// No subtag validation is performed. | |||
/// | |||
/// No subtag validation or alias resolution is performed; use `LocaleCanonicalizer`. |
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.
/// No subtag validation or alias resolution is performed; use `LocaleCanonicalizer`. | |
/// For validation and canonicalization, see `LocaleCanonicalizer`. |
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 think it is useful to explicitly call out that this function does not perform validation and canonicalization. If you expand the file, there is a list of three levels of conformance, and this function performs one but not the other two.
It is still a bit confusing that the previous line references "bogus subtags" without any definition of what "bogus" means.
@zbraniecki Do you have a wording suggestion? |
I don't like
|
OK I applied that suggestion. Look good to merge? |
components/locale_core/src/langid.rs
Outdated
/// Any syntactically invalid subtags will cause the parsing to fail with an error. | ||
/// | ||
/// This operation normalizes syntax only. No legacy subtag replacements is performed. | ||
/// For data validation and subtag canonicalization, see `LocaleCanonicalizer`. |
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.
Why "data validation" instead of "validation"? Why "subtag canonicalization" instead of "canonicalization? The list above doesn't say "well-formed", "data-valid", and "subtag-canonical".
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'm ok with changing it to:
This operation normalizes syntax to well-formed. No legacy subtag replacements is performed.
For validation and canonicalization, seeLocaleCanonicalizer
.
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.
Done.
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.
nb: I would even shorten it to
This operation normalizes syntax to be well-formed. For validation and canonicalization, see LocaleCanonicalizer.
because it follows from the definition above that "normalizing syntax to be well-formed" does just that, and subtag replacement is part of canonicalization.
Follow-up from #5296
I couldn't linkify them because of the dependency order