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

Add dictionary support for hyphens #1714

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

jamesnw
Copy link
Collaborator

@jamesnw jamesnw commented Aug 30, 2024

Adds language support for hyphens. Pins support on the auto value. For more discussion, see #1714 (comment).

Initial descriptionThis naming and split seems odd, but the support story here is that `hyphens` support for English was added initially, and now support for other languages is quite spotty. Only 13 of the 60 non-English languages are baseline low.

Also adds auto and language_english to hyphens, which also better brings it inline with Caniuse.

We should ensure that this does not communicate that English is the default language, but rather that English was the only supported language initially.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Aug 30, 2024
@@ -2,3 +2,8 @@ name: Hyphenation
description: The `hyphens` CSS property controls when long words are broken by line wrapping. Although called `hyphens`, the property applies to word-splitting behavior across languages, such as customary spelling changes or the use of other characters to mark an intraword line break.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we mention in here somewhere that the rules used for breaking up words only work for English? This way, it makes more sense why there's also a non-english hyphens feature.

chrome_android: "55"
edge: "79"
edge: "88"
Copy link
Contributor

Choose a reason for hiding this comment

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

The only weird thing here is that caniuse shows Edge as fully supported only since version 105. It says this about Edge 88 to 104: "Only supported on Android & Mac platforms". I think that might be a bug on caniuse. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, it looks like Caniuse is correct - Fyrd/caniuse#5793, but I can't find any mention of the issue in BCD. I think this would be a good candidate for further investigation in #1499.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -0,0 +1,67 @@
name: Non-English hyphens
description: The `hyphens` CSS property uses language-specific rules to determine when long words are broken by line wrapping. The content language is set with the HTML `lang` attribute.
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this description should make it clearer that this is for non-English and that readers are supposed to have read the description for hyphens first.
I know it's in the name, but I feel like there needs to be more of a connection between the two features somehow.

Having a see_also field would be useful for this kind of feature. Or, perhaps, we can put them together in a new group, maybe called typography (which would be under the CSS group).

As for the description, how about something like this: "When used with a non-English HTML lang attribute value, the hyphens CSS property uses language-specific rules to determine when long words are broken by line wrapping."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Having a see_also field would be useful for this kind of feature.

I agree, that would be useful.

For the description, I want to stay away from the idea that English is the default- per the spec, you should need to also specify your language as English in order to get English hyphens. As I think through this, the reason I split them apart was to tell a fuller support story, but unless we split each language into a feature, it won't be possible for someone to differentiate between French support (baseline low) and Esperanto support (none).

Because of this, I'm proposing that I combine the two into a single hyphens feature, and adding a note that "support for non-English languages varies". While that violates the "don't mention support in the description" rule from the style guide, it does seem important to let people know. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because of this, I'm proposing that I combine the two into a single hyphens feature

I agree it makes sense to merge this into a single feature, with support based on the auto value, which is really the new functionality people are looking for in most cases. Then the description can mention the property is applied contextually based on specified language.

Ideally there would be a way to link to more context in a case like this?

If anything is split out to show specific language support, that could be done language-by-language.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've joined them in e730703

@jamesnw jamesnw changed the title Add non-English hyphens Add dictionary support for hyphens Sep 5, 2024
chrome_android: "55"
edge: "79"
edge: "88"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -1,4 +1,73 @@
name: Hyphenation
Copy link
Collaborator

Choose a reason for hiding this comment

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

It'd be nice to link to this issue from a comment, so we can return to this "support for non-English…" text later #915

@ddbeck ddbeck merged commit 98f927d into web-platform-dx:main Sep 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants