Uploaded image for project: 'BookBrainz'
  1. BookBrainz
  2. BB-771

Specify `lang` attribute for site and elements

XMLWordPrintable

      Mozilla recently introduced “fullpage translation” into the Firefox browser. This feature currently suggests translating based on guessing the language of the page and will, as I’m writing this ticket, suggest that https://bookbrainz.org/ is in German and offer to translate it as such to English. I’m guessing this is based on all of the “Recent Activity” being in German.

      I’m not finding anything in their release notes about it respecting `lang` attributes, but AFAICT `lang` attributes also currently aren’t any set anywhere on BookBrainz.

      In addition to possibly helping out the Firefox translation, this is also a general accessibility concern and one of the criteria for A and AA levels of compliance with the WCAG:

      Given that at least some data inputs (notably entity names) already have a language associated with them, it would be great to also put a `lang` attribute in whatever HTML those inputs are contained in when they’re presented. So e.g., for https://web.archive.org/web/20231027125944/https://bookbrainz.org/ you would have <html lang="en"> for the page and <div lang="de"> around the German names (the <svg>s inside those divs should probably, again, have lang="en" attribute since they contain some textual information aligning with the site language).

      The sitewide (and SVG) lang attribute should obviously be dynamic whenever BB becomes translatable/localisable, but should be okay to hardcode as "en" until then.

            Unassigned Unassigned
            freso Freso
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Version Package