-
Notifications
You must be signed in to change notification settings - Fork 120
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
Does not work with traditonal vs simplified Chinese #55
Comments
I have a fork here that has implemented fallback for Chinese languages: https://github.com/mobiledefense/http_accept_language Information about the algorithm used to select the appropriate locale is in the README.md |
This is also an issue with English. config.i18n.available_locales = %w(en en-CA en-AU en-GB zh-CN fr es) The gem seems to return en no matter what variety of English the end-user browser is requesting (in this case US English) for Canadians, Aussies, Brits as well. |
Yeah pretty weird that it was implemented the way it is |
I can no longer recommend this gem for any project unless this behaviour gets fixed. Either with a new method that preserves regional variance or by updating the existing method to return the correct region. To not break current (buggy) behaviour, I suspect adding a new method that preserves regional variance might be better, given it could cause problems if the currently buggy behaviour of apps receiving browser headers asking for |
What gem is everyone else using if not this one? |
The way that this gem throws out everything after a dash means that it is broken for Chinese locales. Typically, the languages codes are zh-hant, zh-hans, zh-CN, zh-TW, etc.
With the default methods, this gem always serves the first zh available zh variant. But almost any internationalized site that supports Chinese will have two or more variants, and getting simplified Chinese when you read traditional Chinese is not a usable situation.
Here's how I worked around it in my app: WikiEducationFoundation/WikiEduDashboard@cea14bc
I suggest that this gem would be a much more robust solution if it followed the RFC spec, rather than the current behavior described in the readme.
The text was updated successfully, but these errors were encountered: