Well Localize works fine for me : $ ./script/console Loading development environment (Rails 2.2.2) irb: warn: can't alias 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, 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 -~----------~----~----~----~------~----~------~--~---
