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 lang attribute that matches the currently selected language #5894

Merged
merged 1 commit into from Aug 22, 2023

Conversation

foxbunny
Copy link
Collaborator

Adds the lang attribute to the HTML element in the layout/indico_base.html and layout/base.html templates.

@foxbunny foxbunny marked this pull request as ready for review August 18, 2023 06:22
@tomasr8 tomasr8 linked an issue Aug 18, 2023 that may be closed by this pull request
@tomasr8
Copy link
Member

tomasr8 commented Aug 18, 2023

Should we use just the language or the full locale? e.g. en rather than en-GB? The region subtag is optional but maybe it's useful in some cases?

@foxbunny
Copy link
Collaborator Author

"Should we use just the language or the full locale?"

Script and region subtags are considered optional. See here:

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#language_tag_syntax

Having the language subtag is enough to pass the success criteria. Now, whether you would like to fine-tune it is up to you. It may be worthwhile to include a ui_language property on the current_locale object, so that this can be controlled from your end later, though.

@ThiefMaster
Copy link
Member

We already have the moment_lang property, maybe we could add html_lang in a similar way?

@foxbunny
Copy link
Collaborator Author

We already have the moment_lang property, maybe we could add html_lang in a similar way?

Sure.

CHANGES.rst Outdated
@@ -25,6 +25,7 @@ Improvements
restrict them to speakers or registrants (:pr:`5670`, thanks :user:`kewisch`)
- Make editing timeline display much more straightforward (:pr:`5674`)
- Allow event managers to delete editables from contributions (:pr:`5778`)
- Add `lang` attribute to `<html>` elements in base templates (:pr:`5894`)
Copy link
Member

Choose a reason for hiding this comment

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

rst uses double backticks for code highlighting (single backticks are already used for rst references and similar features)

@ThiefMaster ThiefMaster enabled auto-merge (squash) August 22, 2023 18:43
@ThiefMaster ThiefMaster merged commit 759d4e6 into indico:master Aug 22, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[A11Y] Add lang attribute to the <html> element
3 participants