Agent Wranglers

Languages and regions Required

Mark foreign words

Mark every passage in another language with its own lang attribute.

How to do it

Wrap foreign phrases in <span lang="…">, using valid language codes. This is WCAG 2.2 success criterion 3.1.2, Language of Parts.

Example

<p>The French call it <span lang="fr">mise en place</span>: everything in its place.</p>

How to check

An accessibility checker such as axe reports no valid-lang failures. A test finds a lang on every element in the translation file's list of foreign phrases.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/languages-and-regions/lang-attribute.