Richard
2009-Dec-05 13:31 UTC
A possible bug in in i18n - how can I check if this is a bug and submit it
Whilst trying to localize the date/time tag 2009-12-01 21:49:59 +0900 I kept getting the error TypeError: can''t convert nil into String coming from activesupport-2.3.4/lib/active_support/vendor/i18n-0.1.3/ lib/i18n/backend/simple.rb:62:in `gsub!'' The code happened to be format.gsub!(/%b/, translate(locale, :"date.abbr_month_names") [object.mon]) format.gsub!(/%B/, translate(locale, :"date.month_names") [object.mon]) object.mon was being called as 12, where the array index would have been 11 for the 12th item hence the error being made, I added a dummy 0 month item in my localization file and it worked... Is this a bug? Please let me know... Cheers Richard -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2009-Dec-06 10:46 UTC
Re: A possible bug in in i18n - how can I check if this is a bug and submit it
On Dec 5, 1:31 pm, Richard <richard.macks...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Whilst trying to localize the date/time tag 2009-12-01 21:49:59 +0900 > I kept getting the error TypeError: can''t convert nil into String > coming from activesupport-2.3.4/lib/active_support/vendor/i18n-0.1.3/ > lib/i18n/backend/simple.rb:62:in `gsub!'' > > The code happened to be > > format.gsub!(/%b/, translate(locale, :"date.abbr_month_names") > [object.mon]) > format.gsub!(/%B/, translate(locale, :"date.month_names") > [object.mon]) > > object.mon was being called as 12, where the array index would have > been 11 for the 12th item hence the error being made, > > I added a dummy 0 month item in my localization file and it worked... >Well looking at the various translation files at http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/ they all have a dummy valye as the first month name, so it would certainly seem that the rails i18n folks are aware of it. They''ve got a google group which would be the sensible place to discuss this further Fred> Is this a bug? > > Please let me know... > > Cheers > > Richard-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Richard
2009-Dec-09 02:25 UTC
Re: A possible bug in in i18n - how can I check if this is a bug and submit it
Thanks Fred for shining some light on that! I will just go along with the fix however odd it is.. Cheers Richard On Dec 6, 7:46 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Dec 5, 1:31 pm, Richard <richard.macks...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Whilst trying to localize the date/time tag 2009-12-01 21:49:59 +0900 > > I kept getting the error TypeError: can''t convert nil into String > > coming from activesupport-2.3.4/lib/active_support/vendor/i18n-0.1.3/ > > lib/i18n/backend/simple.rb:62:in `gsub!'' > > > The code happened to be > > > format.gsub!(/%b/, translate(locale, :"date.abbr_month_names") > > [object.mon]) > > format.gsub!(/%B/, translate(locale, :"date.month_names") > > [object.mon]) > > > object.mon was being called as 12, where the array index would have > > been 11 for the 12th item hence the error being made, > > > I added a dummy 0 month item in my localization file and it worked... > > Well looking at the various translation files athttp://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/they > all have a dummy valye as the first month name, so it would certainly > seem that the rails i18n folks are aware of it. They''ve got a google > group which would be the sensible place to discuss this further > > Fred > > > > > Is this a bug? > > > Please let me know... > > > Cheers > > > Richard-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.