In my locale rails console, I can see that I have the following locales available via the I18n gem
> I18n.available_locales
=> [:en, :de, :es, :ja, :"pt-BR", :"zh-CN", :"zh-HK", :"zh-TW"]
I try using localize with a specific date format in English -
> I18n.with_locale("en") { I18n.l(Time.zone.now, format: "%B, %Y") }
=> "April, 2016"
Which works great. Then I try the same thing with Spanish and Japanese -
> I18n.with_locale("es") { I18n.l(Time.zone.now, format: "%B, %Y") }
=> "s, 2016"
> I18n.with_locale("ja") { I18n.l(Time.zone.now, format: "%B, %Y") }
=> "s, 2016"
It looks like the month name is being translated as "s".
The rails I18n gem definitely defines month names for the above locales. Does the #localize method even make use of those, or is it trying to pull from elsewhere?
Thanks!
I18n.with_locale("es") { I18n.l(Time.zone.now, format: "%B, %Y") }works for me, butI18n.with_locale("ja") { I18n.l(Time.zone.now, format: "%B, %Y") }doesn't. What version of rails are you using? - Anthony E