-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
TypeError (no implicit conversion of String into Integer) -- While using I18n.l
#534
Comments
I'm able to reproduce this issue using this source 'https://rubygems.org'
gem 'i18n', '~> 1.8.3' And this test script: require 'bundler'
Bundler.setup
require 'i18n'
I18n::Backend::Simple.send :include, I18n::Backend::Fallbacks
I18n.enforce_available_locales = false
I18n.fallbacks = [I18n.default_locale]
class Product
def updated_at
Time.now
end
end
product = Product.new
I18n.l product.updated_at, format: :long, locale: "un-supported" Thank you @sshaw for the great steps to reproduce. I will start investigating this issue this morning. |
I believe I have a fix for this in b751041. I will let CI be the final judge of that. What was happening:
A workaround for this would be:
This correctly sets But this is Ruby! We can be lazy and make the code do this for us. This is what I hope b751041 will fix for us. I'm sorry for the trouble and for the delay in attending to this issue. COVID and friends have messed with my schedule more than I would have liked. |
I had:
And things like:
Worked great! Used default locale's
:long
.Then I upgraded to said version, and I cannot get this behavior back.
Gives:
Along with other seemingly correct config permutations give:
Back to 1.0.1! 🔒
Originally posted by @sshaw in #415 (comment)
The text was updated successfully, but these errors were encountered: