Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why convert locales to lowercase in methods like setLocaleFromQuery()? #88

Open
leohihimax opened this issue Dec 24, 2015 · 2 comments
Open

Comments

@leohihimax
Copy link

Some methods like setLocaleFromQuery(), setLocaleFromCookie() will convert the locale to lower case. I see a lot of projects use uppercase letter in their i18n locales file name like en-US.json, zh-CN.json.
Also, the accept language in HTTP request header use the uppercase letter in the locale like en,zh-CN;q=0.8,zh;q=0.6.
So my question is why those methods convert locales to lowercase? Why not just keep the original case?

@gjuchault
Copy link
Collaborator

Maybe @jeresig can answer to this (he wrote/forked this code)

@holm
Copy link

holm commented Feb 10, 2016

I've just run into the same problem after upgrading. We use uppercase for the country part, which now means it won't match f.ex. zh-CN. Not sure how this could be resolved, but ideally it would case-insensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants