I am testing the preview, got into 2 issues
1- cannot use symbols (:en, :fr, :es...) for I18n.locale , MUST be
'en', 'fr' 'es'..... is it right ?
using symbols leads to '--- :fr' stored as locale in the DB.... so
cannot be found later
2- Tested date localization in the console.. it fails ...
I18n.l(Time.now) or I18n.localize(Time.now) .. leads to TypeError:
can't convert Hash into String
Trying to debug... in I18n
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
active_support/vendor/i18n-0.0.1/i18n.rb:172
backend.localize(locale, object, format)
irb(I18n):001:0> locale
=> :en
irb(I18n):002:0> object
=> Thu Jan 08 23:25:47 +0100 2009
irb(I18n):003:0> format
=> :default
irb(I18n):004:0> backend
=> #<Globalize::Backend::Static:0x248d4f4 @initialized=false,
@translations=nil>
irb(I18n):005:0> backend.localize(:en, object, :default)
TypeError: can't convert Hash into String
the error is in Globalize
../vendor/plugins/globalize2/lib/globalize/translation.rb:21:in
`initialize'
I tried also a string locale : backend.localize('en',
object, :default) same error
debugging further , got :
.../vendor/plugins/globalize2/lib/globalize/backend/static.rb:31
result = orig_interpolate(locale, string, values)
(rdb:1) irb
irb(#<Globalize::Backend::Static:0x248d01c>):001:0> locale
=> :en
irb(#<Globalize::Backend::Static:0x248d01c>):002:0> string
=> {:long=>"%B %d, %Y %H:%M", :default=>"%a, %d %b %Y %H:%M:%S
%z", :short=>"%d %b %H:%M"}
irb(#<Globalize::Backend::Static:0x248d01c>):003:0> values
=> {}
then a little bit further
vendor/plugins/globalize2/lib/globalize/translation.rb:22
set_meta meta
(rdb:1) irb
irb():001:0> string
=> {:long=>"%B %d, %Y %H:%M", :default=>"%a, %d %b %Y %H:%M:%S
%z", :short=>"%d %b %H:%M"}
irb():002:0> cont
TypeError: can't convert Hash into String
what's wrong ?
can I bypass the Globalize backend for date localization ? ( I just
need Model translation, which is running fine with locale as string...
thanks for your help
erwin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rails-i18n" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rails-i18n?hl=en
-~----------~----~----~----~------~----~------~--~---