I have a single-page website that loads an AngularJS application that supports different languages.
All the views for the website are rendered in the browser via JavaScript after the HTML has been loaded from the server.
I understand the value of setting a correct language attribute for <html lang="en">
when Google indexes the static pages.
I am wondering if I need to update this language attribute when AngularJS dynamically changes languages. For example; The user can select from a dropdown which language the interface is shown as.
When the language changes there is no re-loading from the server. So the last setting <html lang="en">
will persist.
Is there any reason that I should update this attribute dynamically when the language changes?
EDIT: This is not a question about google or web crawlers. I'm wondering if this attribute is used by the web browser in anyway.
Yes. Screen readers use this attribute. But you also have to test that screen readers would consider correctly a dynamic change in this attribute.
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