We are currently serving the initial index page for a single page application without the lang attribute set on the HTML tag. At the moment we are also not setting it dynamically after the page is loaded.
Are there any problems with screen readers if the language is set dynamically instead of already setting it on the initial page?
Modern screenreaders understand javascript and use the javascript modified DOM instead of the initial DOM.
As long as you do not change the lang
attribute too late (after the screenreader already started to speak), it should work.
Note that switching language might result in some bugs if you do not also change the current URL using the HTML5 api history.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With