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

Sidebar close button localisation #1241

Open
thisisjofrank opened this issue Dec 6, 2024 · 0 comments
Open

Sidebar close button localisation #1241

thisisjofrank opened this issue Dec 6, 2024 · 0 comments

Comments

@thisisjofrank
Copy link
Collaborator

thisisjofrank commented Dec 6, 2024

  <button
            type="button"
            aria-label="Close navigation bar"
            id="sidebar-close"
          >
            <svg
              viewBox="0 0 15 15"
              width="16"
              height="16"
              class="text-foreground-secondary"
            >
              <g stroke="currentColor" stroke-width="1.2">
                <path d="M.75.75l13.5 13.5M14.25.75L.75 14.25"></path>
              </g>
            </svg>
          </button>

This works for English, but it's better to use text, rather than an attribute, for localization/i18n purposes. Text is more easily translated, where attributes may not be. So the ideal markup here would look like this (overly simplified) example:

<button>
  <svg aria-hidden="true" />
  <span class="sr-only">Close navigation bar</span>
</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant