florrain / locale

Browser locale negotiation for node.js
MIT License
257 stars 36 forks source link

Browser language strings are - versus _ #4

Open digitalrinaldo opened 12 years ago

digitalrinaldo commented 12 years ago

I was just wondering is there is an option for mapping enUS to en-US the browsers ask for locales using a "-" instead of an "" and thanks for the useful library.

aseemk commented 11 years ago

+1. I'd actually love any insight/clarity into when to choose - vs. _.

stuartf commented 11 years ago

The - format used in HTTP is defined in RFC 2616 Section 3.10 and the _ format is used on Posix (linux, unix, OSX) though I'm currently unable to find the spec that defines it.

danielesegato commented 7 years ago

Locale objects currently have fields:

wouldn't it be enough to add a browserized param with language lower case, dash, country lower case? (es. en-us)