-
Notifications
You must be signed in to change notification settings - Fork 79
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
Relative time is parsed differently between languages #277
Comments
That behavior is correct, or at least intended, however if you know the input is going to be English you could always switch the language to that & turn it back afterwards? Going to close this as it’s intended behavior but I hope that gives you a path to a smoother workaround... |
Thank you for the tip. An uncharitable reading of your comment would be the intended behaviour is chaos and confusion. I assume you don't mean it but closing the issue seems premature. If the intended behaviour is to parse localized strings, 146/156 locales in the library are incorrect - that seems like a serious bug to me. Sure, it's unfeasible to fix so many locales at once but at least documenting the behaviour and warning about the low penetration might save others the pain of figuring out for themselves. |
If you feel you can fix the regex for Romanian to your satisfaction a PR is welcome. |
I'm not a Romanian speaker but I added Czech. |
Most supported languages (146/156) allow to parse strings like
-1 year
in English (our use case is a date range picker with some predefined ranges). Some languages, however, have the regexps localized and thus fail with the input in English, e.g. Romanian bc2c7a6It's unclear which behaviour is correct. Given that these regexps live in a hash alongside regexps which need to be localized it makes sense to localize them as well. On the other hand, vast majority parses this input only in English.
In our case, we need to parse the English version in every language and had to override the localized regexps.
The text was updated successfully, but these errors were encountered: