Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12055,6 +12055,9 @@ <h2>Translatable Attributes</h2>
<li><pref>aria-rowindextext</pref></li>
<li><pref>aria-valuetext</pref></li>
</ul>
<p class="note">
Due to limitations across the web accessibility stack there is currently no mechanism to specify language and directionality for a translatable attribute separately from the element's language and directionality. This also indirectly applies to <pref>aria-labelledby</pref> and <pref>aria-describedby</pref> because the <a href="" class="accname">Accessible Name and Description Computation</a></cite> [[ACCNAME-1.2]] results in a flat string. Diverging in language or direction can also cause other accessibility problems, see [[WCAG21]].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

About "diverging in language or direction can also cause other accessibility problems", what does this refer to? Are there any examples?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

E.g. WCAG 2.5.3 seems likely to fail. Adjusting one of the examples in F96: <button id="sitesearch" aria-label="Find in this site">Finde in dieser Seite</button>.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. I think it might be useful to link to (or add) a concrete example in the note.

@cookiecrook cookiecrook Jul 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From looking back at the issue, we could consider discussing this in the context of an example like:

<button lang="en" aria-label="This string can't represent multiple languages or directions.">
  There's a certain <span lang="fr">je ne sais quoi</span> about him.
<button>

Of note: French and English TTS engines won't have a problem pronouncing either language in that label, so a western+nonwestern language example might be better to use, if you can think of a non-contrived one.

Some other solutions that may be reasonable.

  1. A new note stating that when the computed label of a leaf node changes language or direction, authors should not use aria-label to vend this. Instead uses nameFrom: contents so that you can appropriately apply the lang and dir attributes to substrings where useful.
  2. A new note that could mention how NLP parsers work, and that, if multiple languages are used, the different substrings might get shuffled off to different TTS engines and/or difference voices.

I'm including that sentence again here without the lang markup in case people want to test in various contexts:

There's a certain je ne sais quoi about him.

<p lang="en">My home town is <span lang="jp">東京</span> but now I live in <span lang="zh">北京</span>.</p> 

My home town is 東京 but now I live in 北京.

In the second sentence, the same kanji (京 for capital) is used in both Tokyo (東京) and Beijing (北京).

In my current testing of the second sentence using VoiceOver on macOS, all three languages are pronounced correctly (w/ or w/o the lang markup), using three different speech engines, which is why I think the NLP note could work. It should also note however, that sometimes NLP has an ambious result, so the web author should avoid relying on langauge changes in translatable attributes if pronunciation is critical.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Then again, on-device models might trim that ambiguity rate down to effectively nothing in the near future, so maybe the caveat isn't necessary.

@cookiecrook cookiecrook Jul 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does HTML or another spec have a similar note? The HTML title attribute, for example, would have this same issue. Instead of writing a new note here, point an ARIA reference to the note in HTML. If it doesn't exist in HTML, this issue could be duped to one on that spec.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

re language detection, see https://www.w3.org/TR/string-meta/#language-detection

re HTML, I couldn't find any specific notes in HTML—only some old bug reports (like 23305 and 8931). I recall there were more in-depth discussions, though I can't seem to locate them right now.

However, this guideline has been part of the i18n specdev for years; perhaps you could refer to it: https://www.w3.org/TR/international-specs/#markup_elements_attributes

</p>
</section>
<section id="global_states">
<h2><dfn>Global</dfn> States and Properties</h2>
Expand Down
Loading