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

King County COVID19 - Bug: Language attributes are missing for the on all translated pages for content not in English #20

Open
alboss opened this issue Apr 30, 2020 · 1 comment
Labels
bug Something isn't working King County COVID-19 Issues logged for the King County COVID-19 site

Comments

@alboss
Copy link

alboss commented Apr 30, 2020

Issue Summary

Screen readers may not announce the language properly without lang attributes.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to https://kingcounty.gov/depts/health/covid-19/languages.aspx
  2. Click on any translated page
  3. Scroll down to the content that's been translated.

Behavior

There is no language declaration, so the screen reader will inherit the page default and read the page like an American trying to sound out foreign words without knowing how to say them.

Expected behavior

Parlez-vous français, monsieur?

Actual behavior

Pahr Lez Vowze Frayn Chaise, Mawn Sewer?

Code

Current Code

<div class="col-sm-12">
   <h3 class="m-t-0"><strong>Qu'est-ce que le COVID-19?</strong></h3>
   <p>Le COVID-19 (précédemment connu sous le nom de « nouveau coronavirus ») est un 
  virus de nouvelle souche qui se transmet d'une personne à l'autre. Il est présent 
  actuellement aux États Unis et dans beaucoup d'autres pays.</p>
  ... etc. etc. etc.
</div>

Suggested Code

We are limited by what we can do in Sitecore, but within each add-on or text field in the editor, put a <div lang="en"> at the very beginning and a </div> at the very end.

<div class="col-sm-12">
  <div lang="en">
    <h3 class="m-t-0"><strong>Qu'est-ce que le COVID-19?</strong></h3>
    <p>Le COVID-19 (précédemment connu sous le nom de « nouveau coronavirus ») est 
    un virus de nouvelle souche qui se transmet d'une personne à l'autre. Il est 
    présent actuellement aux États Unis et dans beaucoup d'autres pays.</p>
    ...etc. etc. etc.
    </div>
</div>

Specifications

Level A

It is important to note that in the absence of Sitecore developers able to work on the County's current platform, if we wish to fully comply with this requirement, we would have to do some fancy Javascript work to inject the language attributes into the left-hand navigation. Although that's one script we can populate downward through all pages below https://kingcounty.gov/depts/health/covid-19/languages.aspx, there's cost in terms of staff work and page load time. There's cost in terms of a Section 503 lawsuit, too, though.

Additional References

https://www.w3.org/International/questions/qa-html-language-declarations

@smhigley smhigley added bug Something isn't working King County COVID-19 Issues logged for the King County COVID-19 site labels May 3, 2020
@alboss
Copy link
Author

alboss commented May 21, 2020

Although the Public Health webmaster could open every single HTML field and put the contents inside a div, that would be rather tedious.

A reusable Javascript in the content management system's media library, that takes a value for the language and injects it into the right place would be a better solution, if we can get a Javascript developer at the county to take it on.

It will take some doing. We can’t just put it into the <div id="main-content">, because the side navigation (not translated) is inside that div. Unfortunately, the content management system isn't using an ID’d container for the actual main content.

We’d have to do something like finding the <!-- PAGE CONTENT BEGINS HERE --> comment, insert <div lang="(value)"> there, then add a </div> before the opening <footer>.

Stay tuned on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working King County COVID-19 Issues logged for the King County COVID-19 site
Projects
None yet
Development

No branches or pull requests

2 participants