Using the lang attribute makes a difference
About a year ago I posted a Quick Tip titled Specify each HTML document’s main natural language. The reason is that software like screen readers can use this info to adjust the way they speak text.
But do they really do that? Well, it depends. You need to use a screen reader that supports language switching and can speak the natural languages of the document you’re viewing. One example of when it works as expected is VoiceOver for the iPhone and for the iPod touch.
Here are a few examples of text in different languages (thank you, Wikipedia).
Svenska
Välkommen till Wikipedia, den fria encyklopedin som alla kan redigera.
Deutsch
Wikipedia ist ein Projekt zum Aufbau einer Enzyklopädie aus freien Inhalten in allen Sprachen der Welt.
Français
Bienvenue sur Wikipédia, le projet d’encyclopédie libre que vous pouvez améliorer.
Español
Bienvenidos a Wikipedia, la enciclopedia de contenido libre que todos pueden editar.
If you have an iPhone or iPod touch, try loading this page after switching VoiceOver on (in Settings > General > Accessibility > VoiceOver). Each language example should be spoken in a different voice and with correct pronunciation instead of with a heavy English accent. This obviously makes it much easier to understand what VoiceOver is saying.
So yes, specifying the natural language does make a difference.
- Previous post: Whenever you use :hover, also use :focus
- Next post: The modern workplace is optimised for interruptions
Comments are disabled for this post (read why), but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.
Subscribe / follow
Sponsors
Authentic Jobs
- Web Project Manager at University of Southern California (Los Angeles, Ca, US)
- Senior Java Developer at Synacor, Inc. (Buffalo, NY, Ne, US)
- iOS Developer at Etsy (Brooklyn, NY, US)
- Senior Engineer: Mobile Web at Etsy (Brooklyn, NY, US)
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost

