-
-
Notifications
You must be signed in to change notification settings - Fork 709
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
Enable programmatic locale switching #173
Comments
I have a patch over at rails-timeago derived from an older PR (#88) as that was necessary to use with Rails (Ruby web framework) along with converted locale files. Maybe that can help you. Feel free to use this for a PR. |
Thanks @jgraichen, that's exactly what I had in mind! I'll play with this and see if it fits my needs. :-) |
@rmm5t Is there any interest in upstreaming the patch from rails-timeago? It has been running in production for over six years now. This has been again requested in #280. Newer Rails versions support webpack and npm too, a few users of the Rails plugin actually asked for a npm version of the patched plugin, which I kindly refused and redirected to your package. I've prepared the changes here and, if you are interested, can open up a PR. |
@jgraichen Yes, I'm open to accepting this upstream patch. Please open a PR for review. Thanks. |
I'd like to be able to switch locales dynamically at client-side if possible. Would it be possible to store the locale settings in hashes, like this (adapted from the fr locale):
This would enable multiple locales to be pulled in at once and selected by using
jQuery.timeago.settings.strings = jQuery.timeago.settings.strings['fr'];
rather than by overridingjQuery.timeago.settings.strings
by pulling in an additional locale file (which either necessitates an additional HTTP request or some server side locale switching).I'm happy to put together a PR with tests if there is any demand for this.
The text was updated successfully, but these errors were encountered: