I have a website which is in Japanese, so I have <html lang="ja">
. The site has some forms containing input elements, including of type type="date"
. No issues when my browser's language is set to Japanese, but if the setting is set to something else, datepickers and other elements using locale render incorrectly by using the language of the browser instead of the language of the content.
Why do browsers ignore lang when rendering form input elements, such as <input type="date">
? Logically thinking, the datepicker provided by the browser should determine the locale from the lang attribute, but this does not seem to be the case. Isn't the purpose of lang to specify the language of the content?
In my opinion, when rendering pages, browser should first look up at lang, and if it doesn't exist, default to browser language. Who on earth has decided that there should be no way to override browser language settings when rendering DOM. thus forcing people to use external libraries instead of native components? I can understand the reasons for not allowing changing language of browser menus and such, but shouldn't there be a way to change the language setting of the content?
Related to: Is there a way to localize input type="date" in HTML5