-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Locales are case sensitive #484
Comments
....well, yes. When started, I decided to leave cases and names of any locale completely untouched and up to the developers or frameworks responsibility to handle it "their way" File systems act differently - which is a well-known issue when working with git on Mac either way. But that's only part of the story. There are query-parameters, accept-headers and developers setting locales programmatically by setLocale() api. The i18n package kept matching locales "as-provided" to their files for ~ 10 years now, which treats 'en', 'en-EN', 'en_EN' individually. Let's say I got mislead by POSIX examples of locales while BCP 47 and other RTF and ISO Standards clearly state to interpret locales, headers and env variables case insensitively. I am back referencing to #128 here. And though I can't think of a reasonable use-case, changing that could break. Adding a simple Points left to consider:
Could i18n normalize locales? Yes. Should i18n normalize locales? Only if this won't break existing implementations. Any further thoughts are welcome. |
Thanks for the extensive response! |
as for docs: https://github.com/mashpie/i18n-node#storage should be more expressive either way :)
feel free to send a pr - or wait until I‘ll manage to write some more words.
… Am 26.10.2021 um 17:05 schrieb PanMan ***@***.***>:
Thanks for the extensive response!
I understand everybody's usecase is different - and you don't want to break current behaviour. However, we Did run into this in our current project - twice, even :). Especially as it did work in development.
I can understand not changing the behaviour, or making it optional, but I do think it would be good to include in the documentation. I thought about a pull request, but it wasn't immediately obvious to me where it would make most sense in the docs.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
This took us some time to debug: Locales are case sensitive when the filesystem is.
On OSX (case insensitive) setting the locale to
NL
got strings fromnl.json
In production, on a linux server, this failed and the strings didn't get translated.
I feel this should at least be in the docs, or always work case-insensitive
The text was updated successfully, but these errors were encountered: