-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 lang attribute to <html> tag for accessibility improvement. #9664
Conversation
Hey @scottbarnes @cdrini , I have updated the lang attribute as mentioned in issue #9634. |
Thanks for this, @Jash2606. The PR has been updated so my original comment no longer reflects the current state of the PR. |
Thanks for this, @Jash2606. Just a heads up that you probably want to add this change to I just skimmed the code and I can't actually tell if this particular sitemap function is being used, but I imagine if the proposed change makes sense in But either way, please test out the changes you've made, e.g., as I did with |
Hey @scottbarnes , Changes done as suggested for head.html also ! |
Hi @Jash2606! I had a look at the info in the issue, and this seems like a good approach to me. I'd second what @scottbarnes said and suggest you test via
The site should now default to
You'll also want to confirm that the language is correctly switched if the bot selects a language, by running:
The site should still switch to
Let me know how it goes! I'll try testing on my end as well, but it would be good to document your own test results in the PR. 🙂 |
@Jash2606 Update: I pulled the PR up on GitPod, and it looks like the code is going to need a slight reword! Here's what it looks like in the dev tools currently: It looks like this is just happening because you forgot the curly braces in the move from Tried adding in the curly braces on my end, and confirmed: |
Hey @rebecca-shoptaw , Updated Syntax changes , Let me know if any further changes required. |
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.
@Jash2606 Great, thank you, and thanks for your great work on this!
Tested via GitPod:
✅ curl
with no specified language defaults to lang="en"
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
✅ curl
with a language specified uses that language
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="es">
<head>
Also, for your next PR I'd recommend having a look at the Git Cheat Sheet -- you'll find it much easier to keep things up to date and avoid manual merges if you create a new branch for each PR, and rebase off the master branch if needed. 🙂
…rnetarchive#9664) Co-authored-by: Jash2606 <jash.23bcs10163@sst.scaler.com>
…rnetarchive#9664) Co-authored-by: Jash2606 <jash.23bcs10163@sst.scaler.com>
Closes #9634
Description
This PR adds a
lang
attribute to the<html>
tag to specify the primary language of the document. This attribute is crucial for accessibility, as it helps screen readers and other assistive technologies interpret the language correctly, ensuring proper pronunciation and comprehension for users. Thelang
attribute has been set to"en"
for English, as this is the primary language of the content.Testing
<html>
tag to confirm the presence of thelang="en"
attribute.Stakeholders
@cdrini