-2

I just learned html and wrote some java script to replace strings according to the language. So what would be a useful tag to set? Is it useful to use something like lang="en|de" ?

Edit: No, this is no duplicate. I dont have a mixed language site. I just have one site that sets the language depending on the browser language.

Paul Woitaschek
  • 6,717
  • 5
  • 33
  • 52
  • possible duplicate of [What attribute value should I use for a mixed language page?](http://stackoverflow.com/questions/7076837/what-html-lang-attribute-value-should-i-use-for-a-mixed-language-page) – showdev Apr 02 '15 at 18:09
  • Thats no duplicate. I dont have mixed language. – Paul Woitaschek Apr 02 '15 at 21:23
  • 1
    Fair enough. The point is that you should only list one language: `a valid BCP 47 language tag, or the empty string`. – showdev Apr 02 '15 at 21:27

1 Answers1

1

The lang attribute should describe the language of the content.

If you change the content with JavaScript (to content in a different language) then change the value of the lang attribute at the same time.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335