Could you post more details about the code your are trying to get
working.

Can you try first with a new rails app and only Gobalize2 plugin.

--
  Sébastien Grosjean - ZenCocoon

On 8 fév, 20:09, lossius <[email protected]> wrote:
> It works for me as well if I test with a Rails app that do not use the
> Globalize2 preview plugin. But if I test this in a Rails app that use
> the Globalize2 plugin, I get the following errors.
>
> Best,
> Trond
>
> TypeError: can't convert Hash into String
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/translation.rb:21:in `initialize'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/translation.rb:21:in `initialize'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/translation.rb:15:in `initialize'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/backend/static.rb:36:in `new'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/backend/static.rb:36:in `translation'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/backend/static.rb:31:in `interpolate'
>         from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:41:in
> `translate'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/backend/static.rb:16:in `translate'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/backend/static.rb:14:in `each'
>         from /Users/lossius/Sites/bekrailsapp/trunk/bek_www/vendor/plugins/
> globalize2/lib/globalize/backend/static.rb:14:in `translate'
>         from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:53:in
> `localize'
>         from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/vendor/i18n-0.0.1/i18n.rb:171:in `l'
>         from (irb):3
>
> >> exit
>
> On Jan 11, 8:31 pm, Sébastien Grosjean - ZenCocoon
>
> <[email protected]> wrote:
> > Well Localize works fine for me :
>
> > $ ./script/console
> > Loading development environment (Rails 2.2.2)
> > irb: warn:can'talias context from irb_context.>> I18n.locale = 'fr'
> > => "fr"
> > >> I18n.l(Time.now)
>
> > => "11 janvier 2009 20:30"
>
> > Warm regards,
> > --
> >   Sebastien Grosjean - ZenCocoon
>
> > On 9 jan, 11:10, Erwin <[email protected]> wrote:
>
> > > answer to myself :
>
> > > keepin alive only :
> > > ActiveRecord::Base.send :include,
> > > Globalize::Model::ActiveRecord::Translated
> > > in the init.rb of Globalize gives me the opportunity to use only the
> > > Model Translation
>
> > > other points are not yet solved... (  using sym or strings for
> > > locales, missing some explanation on I18n compatibility for date
> > > localization...)
>
> > > On 8 jan, 23:52, Erwin <[email protected]> wrote:
>
> > > > I am testing the preview, gotinto2 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'tconvertHashintoString
>
> > > > 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'tconvertHashintoString
>
> > > > the error is in Globalize
> > > > ../vendor/plugins/globalize2/lib/globalize/translation.rb:21:in
> > > > `initialize'
> > > > I tried also astringlocale  :   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'tconvertHashintoString
>
> > > > what's wrong ?
> > > > can I bypass the Globalize backend for date localization ? ( I just
> > > > need Model translation, which is running fine with locale asstring...
>
> > > > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to