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

Print view doesn't include the Language Attribute #3294

Closed
Blackflighter opened this issue Feb 11, 2024 · 7 comments · Fixed by #3296
Closed

Print view doesn't include the Language Attribute #3294

Blackflighter opened this issue Feb 11, 2024 · 7 comments · Fixed by #3296
Labels
Approved Has been discussed and an approach is agreed upon tweak Small, non-breaking change UI/UX User Interface, user experience

Comments

@Blackflighter
Copy link

Blackflighter commented Feb 11, 2024

Renderer

v3

Browser

Firefox

Operating System

Linux

What happened?

When opening up one of my brews in Print view (link here), I noticed that the hyphens: auto CSS that I had set up was not being made use of. As a result, none of the hyphenations appeared where they were supposed to, causing some text overflow.

Taking a quick look via the element inspector, it turned out that this was due to the Print view lacking the lang="en" attribute (as opposed to the regular view, where things worked as expected as can be seen here).

Introducing this attribute to the Print view's <div class="pages"></div> element (the same as the regular view) should fix that up - manually doing so in the element inspector got the hyphenation working as expected.

@5e-Cleric
Copy link
Member

Good catch, should have thought of adding lang attribute to print too, we'll be right on it.

@5e-Cleric 5e-Cleric linked a pull request Feb 12, 2024 that will close this issue
@5e-Cleric
Copy link
Member

That Pull Request adds in the fix by setting the lang attribute on the div.pages element, which is high enough in the DOM to work and low enough to be accessed easily in the current configuration of the page.

@Blackflighter
Copy link
Author

Very nice, and looks like it was even a relatively simple fix - many thanks!

Just one thing (from just a cursory glance, so I might very well be wrong here): the current default value for the lang attribute seems to be en as opposed to en-US (though that was located in a different part of the repo). Maybe that ought to be adjusted accordingly?

@5e-Cleric
Copy link
Member

Actually no, as defined by W3C, lang codes in html do not include the country.

https://www.w3.org/International/O-help-lang.html

@Blackflighter
Copy link
Author

Ah! To clarify my words, perhaps the en-US should have been changed to en - looks like you made the change already.

@ericscheid
Copy link
Collaborator

Actually no, as defined by W3C, lang codes in html do not include the country.

https://www.w3.org/International/O-help-lang.html

That's a very old reference. More recent specs make mention of country and dialect variations.

https://www.w3.org/International/questions/qa-html-language-declarations

@5e-Cleric
Copy link
Member

According to that spec:

BCP 47 incorporates, but goes beyond, the ISO sets of language and country codes. To find relevant codes you should consult the IANA Language Subtag Registry.

Checking that:
image
So, no country codes anyway.

@5e-Cleric 5e-Cleric added tweak Small, non-breaking change UI/UX User Interface, user experience Approved Has been discussed and an approach is agreed upon labels Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Has been discussed and an approach is agreed upon tweak Small, non-breaking change UI/UX User Interface, user experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants