Add support for I18n on the date filter #111

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

Hi,

I'd like to have support for I18n when displaying dates with liquid in my rails app. This comes from a real user scenario and I'd like to see it upstream instead of having to patch the library. Hope this helps, let me know if there's anything else I can do.

P.S. I haven't added tests because I didn't want to introduce an external dependency.

Owner

tobi commented Mar 22, 2012

Please add a unit test and I'll merge.

Owner

tobi commented Mar 22, 2012

Actually, the problem is that I18n.localize isn't side effect free. It relies on a global setting of which locale is the currently active one. Liquid needs to be sandboxed from the outside and can't rely on such effects.

My recommendation is to create a new filter called i18n_date

tobi closed this Mar 22, 2012

I will do that, thanks.

oscardelben referenced this pull request Mar 22, 2012

Closed

Add support for i18n #112

@tobi could you please take a look at #112 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment