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

Non-English locales are broken #1

Open
stestagg opened this issue Dec 8, 2017 · 0 comments
Open

Non-English locales are broken #1

stestagg opened this issue Dec 8, 2017 · 0 comments

Comments

@stestagg
Copy link
Owner

stestagg commented Dec 8, 2017

If the current system locale is non-english, then date handling is broken. The regex is tuned for english days and months, but uses the calendar module to do actual lookups, meaning that things will go wonky pretty fast if anyone uses this library with a non en_US or similar locale.

In the spirit of being explicit and avoiding ambiguity, my current thinking is:

  1. Find a way to let the user to pass in some locale info into the DateFormat init.
  2. Use that to build a regex that matches the locale-specific days and months
  3. Make the DateFormatPart classes honour the passed-in locale info.

Right now, the regex is a class variable, so some tweaks will have to happen to allow this to work, but shouldn't be too hard.

I'm investigating how to do runtime locale info querying without mutating global state, and will update once that is complete

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

1 participant