-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
For attributes which can contain a mix of languages, provide markup for language of parts #8280
Comments
I can report that Live regions (such as HTML5's |
@brennanyoung Thank you for that insight, which I was not aware of. I respectfully suggest you file that as a separate issue. This particular issue (#8280) is specifically concerned with language of parts within HTML attributes. I do have a comment on your post, and will be happy to add it once you've created a new issue, so please add a cross-reference to your issue here. |
Thanks Chas. As well as aria-label and the others you mentioned the attributes listed under https://www.w3.org/TR/wai-aria-1.2/#translatable-states-and-properties may be added aria-placeholder Other attributes that may be relevant here are those that derive text from other elements, such as If element A gets its name, details, description or error message from the text nodes inside element B, how should "lang" work? Should B dictate the language? Should a lang on A override a lang on B? Maybe some kind of fallback algorithm, like with font-family or accessible name computation? So, part of the problem is that we need to clarify how we would prefer it to behave! I'm not sure. |
As well as the 'inline' change of language mentioned above, there is also a problem if the textContent is in one language but the attribute is in another. For example, this kind of language switch may appear at the top of an English page:
(Fwiw, these issues are the reason the i18n WG recommends never to put localisable text in attributes. See https://www.w3.org/TR/international-specs/#markup_elements_attributes) |
FYI HTML defines several translatable attributes, so this is not just an ARIA thing. |
WCAG 2.0 AA requires the meeting of Success Criterion 3.1.2, Language of Parts, such that content that is in a language that is not the page's language can be marked as being in a different language. If that content is in an attribute which would be read aloud by a screen reader, there is currently no non-kludgey way to mark content which is in a mix of languages.
For example, given an image which bears the text "This is the text. Este es el texto." as an image of text, the correct alt text for that image would contain all of the text shown. However, there is no way to mark that alt text correctly for language.
is insufficient. Syntax such as the following might solve this issue:
On a page marked as being lang="en":
On a page marked as being lang="es":
Attributes which would need this support include, but may not be limited to:
alt
title
aria-label
The text was updated successfully, but these errors were encountered: