←back to thread

286 points mnemonet | 2 comments | | HN request time: 0s | source
Show context
TheSisb2 ◴[] No.45891137[source]
Native datepickers fall apart when you need to handle different date formats as user preferences (not as browser default)
replies(1): >>45891529 #
1718627440 ◴[] No.45891529[source]
The browser, called the User Agent (UA), IS the program the user uses to interact with a website according to his preferences.
replies(3): >>45892159 #>>45896659 #>>45897303 #
sedatk ◴[] No.45896659[source]
That doesn't always work well in practice. I'm bilingual, and my preference is to use the locale closest to the language of the web site I'm visiting because it feels the most culturally coherent and the least surprising.

I just can't reset my regional settings whenever I switch tabs.

replies(1): >>45896957 #
1718627440 ◴[] No.45896957[source]
I also find this annoying, but this is due to websites ignoring the browser preferences. The browser supports specifying multiple languages and the website could select the one that the content is native in.
replies(1): >>45897439 #
sedatk ◴[] No.45897439[source]
I don’t think there’s a browser setting that lets you use the locale the web site’s language in, is there?
replies(1): >>45898743 #
1718627440 ◴[] No.45898743[source]
You set all the language you want with priorities and the webserver knows it's own language and serves you the intersection with the highest priority. Or do I misunderstand your question?
replies(1): >>45899365 #
1. sedatk ◴[] No.45899365[source]
I mean the locale, not the language. Many web sites are in a single language and target a specific culture. I want that to be respected by the browser for input type=date and other similar elements based on web site’s language, not the other way around. That’s my preference.
replies(1): >>45899428 #
2. 1718627440 ◴[] No.45899428[source]
What your browser calls a language, is in fact a locale. You specify en_US, not English.

That would be equivalent to no setting a preferred locale or adding all the available locales.

   <html lang=...