Why a language setting matters to a visitor
A screen reader needs to know which language it is speaking. If a page does not say, the reader may use the wrong voice, and an English sentence comes out mangled. The same thing happens in reverse when a Spanish phrase on an English page is read with English pronunciation, so a welcoming line becomes unintelligible to the person it was written for.
The W3C has two criteria for this, and we read both before writing. Language of Page says the default human language of each page can be determined by software. Language of Parts says the language of each passage or phrase can be determined too, except for proper names, technical terms, words of indeterminate language and words that have become part of the surrounding language.
Step one: the page language
The page language lives in the opening tag of the page code, written as html lang with a short code. English for the United States is en-US, or simply en. Most themes set this correctly, but sites built from templates sometimes carry another language code from a foreign-language demo, or no code at all.
- 1Open the page in Chrome, right-click and choose View page source.
- 2Look at the very first lines for the html tag. It should read lang with en or en-US.
- 3Repeat on a Spanish page, if you have one. It should read es, or a regional form of it.
- 4If the code is missing or wrong, give your web designer the page address and the correct value.
Step two: a Spanish phrase inside an English page
Many Florida counseling practices add a line such as Hablamos español beside a phone number, or a Spanish sentence on the contact page. The W3C says the language of such a phrase should be marked as well. In practice, your designer wraps it in a small container and gives it lang es.
- Mark whole sentences and short phrases, not only long passages. The W3C note says even a single word can need it unless an exception applies.
- Do not mark proper names, such as the name of the practice, or words readers already treat as English.
- A phrase that appears in an image needs the same words in the alt text, in the correct language.
What to do if you offer a full Spanish version
A complete Spanish page should have its own address and es declared on the page itself, as covered in our guides on Spanish and English SEO for a Florida practice and the bilingual counseling page. Part marking is for the occasional phrase inside an otherwise English page.
A two-minute test with a screen reader
Turn on the built-in screen reader on your phone or laptop, open the page and listen to the Spanish line. The voice should switch to Spanish pronunciation. If it reads in English, ask for the marker. Our five-minute screen reader test shows how to start the reader and move around a page.
Listing the languages your staff speaks is a separate task, covered in how to list languages spoken and interpreter access. Do not claim a language unless a trained person is actually available to use it with clients.
Frequently asked questions
What does the language setting look like?
It is a lang value on the page's opening html tag, such as en-US. Visitors never see it, but screen readers, translation tools and some browsers use it.
Do I have to mark every Spanish word?
The W3C expects phrases and passages to be marked, with exceptions for proper names, technical terms and words that have become part of the surrounding language. When in doubt, mark the full phrase.
Will this help Spanish-speaking patients find us?
We cannot promise that. It makes the page read correctly for someone using a screen reader. Finding you in search depends on real Spanish pages, listings and reviews.
Is the language setting the same as hreflang?
No. The page language is for people and their software on that page. Hreflang tells search engines which language version of a page matches which audience.
Who should make the change?
Your web designer. Ask them to confirm the page language on the template and to mark the Spanish phrases, then listen to the result with a screen reader.
Sources
- W3C Web Accessibility Initiative — Understanding Success Criterion 3.1.1: Language of Page
- W3C Web Accessibility Initiative — Understanding Success Criterion 3.1.2: Language of Parts