skip to content

Language

Include the language component as the first element after the skip link (see the layout demo source).

Light theme

Dark theme

Invoke the dark theme on any component by applying class="ds-dark" to a container element.

Markup


<aside class="ds-language" aria-labelledby="language-label">
    <ul>
        <li id="language-label" aria-hidden="true">Language:</li>
        <li><a href="/english" lang="en" aria-current="true">English</a></li>
        <li><a href="/cymraeg" lang="cy">Cymraeg</a></li>
    </ul>
</aside>

Language picker as a form

Some applications (e.g Django) change language using a form / POST requests. In this case it's possible to wrap the language picker elements in a form tag and use buttons for each language:

Light theme

Dark theme

Invoke the dark theme on any component by applying class="ds-dark" to a container element.
<aside class="ds-language" aria-labelledby="language-label">
  <form action="" method="post">
    <ul>
      <li id="language-label" aria-hidden="true">Language:</li>
      <li>
        <button name="language" value="en" lang="en" aria-current="true">
          English
        </button>
      </li>
      <li>
        <button name="language" value="cy" lang="cy">
          Cymraeg
        </button>
      </li>
    </ul>
  </form>
</aside>