florrain / locale

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

Instance default #20

Closed VaclavObornik closed 8 years ago

VaclavObornik commented 10 years ago

When more then one instance of supported languages is needed, each instance should be able to have different default value.

omsmith commented 10 years ago

I'd like to see something like this. Turns out when Accept-Language is undefined, the Locale.default is returned, which isn't necessarily part of our supported lang list.

So passing in the default, or taking the first item in the array as default would be good.

new locale.Locales(['en_GB', 'en_CA', 'fr_CA']).default === 'en_GB'

ovvost commented 10 years ago

This is useful fix

florrain commented 8 years ago

Really useful!

@jed Can you merge this in and maybe publish a new release?

florrain commented 8 years ago

Hey @VaclavObornik can you rebase on the latest master revision please? I'll handle the merge and publish but there are conflicts that need to be handled first.

rhagigi commented 8 years ago

@florrain @jed It's been 2 years since this PR was opened. Unsure if @VaclavObornik is still paying attention or wants to deal with this.

This is an issue that I'd like fixed ASAP, so I went ahead and made a branch on my fork rebased to master and updated his commits to fix merge conflicts. Since technically by rebasing, I amended his commits, and I feel weird about that (the commits are still authored by him, but I amended them), I also created a merged (not rebased) branch which I'll open the PR from. If you'd rather I PR the rebased one, let me know. Or if you'd rather I rebase and squash let me know.

florrain commented 8 years ago

Thanks @rhagigi I replied on the other PR, let's coordinate next steps from there.