Skip to content
This repository

`I18n.l Time.now` raises I18n::MissingInterpolationArgument in 0.4.0 #20

Closed
apeiros opened this Issue June 02, 2010 · 5 comments

4 participants

Stefan Rusterholz Krzysztof Knapik José Valim Raj
Stefan Rusterholz

Doing I18n.l Time.now raises I18n::MissingInterpolationArgument: missing interpolation argument in "%{count}.%m.%Y %H:%M" ({:object=>"Wed Jun 02 10:25:27 +0200 2010"} given)
The translation string "%{count}.%m.%Y %H:%M" is in none of our locales, neither is it contained in I18n.backend.instance_variable_get(:@translations) from which I'd conclude that it is a hard-coded default.
Our localizations file (confirmed by retrieving it untranslated value from the I18n.backend) contains for en.time.formats.default: "%d.%m.%Y %H:%M" which doesn't match the one in the exception.

Krzysztof Knapik
Collaborator
knapo commented June 02, 2010

which Rails version do you use? I18n 0.4.0 works with 2.3.6+

José Valim
Collaborator

A quick search for %{count} inside the I18n library shows that nowhere inside the gem we have that translation stored. If you are using it inside Rails, try the following:

$ rails console
I18n.reload!
I18n.backend.send(:translations)

And see if it returns the guilty key! Thanks!

Krzysztof Knapik
Collaborator
knapo commented June 02, 2010

It's probably due to AR's i18n_interpolation_deprecation.rb which has been removed in AR 2.3.6

José Valim
Collaborator

Fixed.

Raj

I know the issue is closed and fixed, but I have another solution which is explained on http://tech-brains.blogspot.in/2012/11/i18n-missing-interpolation-argument.html

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.