How build two translated model in the same time with globalize2?

Hi, I a new user of ruby on rails (2.3.4) and globalize 2 (0.2.0). I
have some prolems to use globalize2.

I think globalize 2 is powerfull and perhaps I don’t understand how it
works… with the documentation, the use seems very simple globalize2
manage all the stuff behind…

ok ok… my problem is : I want create a model with the default
language (:fr) so it’s simple to do that… but after I want create
another translations of this model (:en or :es or :de or :it …)
without change of the current language… and the validation have to
works on this translation to… is it possible and how ?

many thanks in advance…

Ok I look further in the plug in and I found one method
“set_translations” which do what I wished… but without validations
example :

I have a Comment model with two translated field and validations on it

I18n.locale
=> :fr

com = Comment.new(“title”=>“lalalalal”,“content”=>“le francais”)
=> #<Comment id: nil, value: 12, created_at: nil, updated_at: nil>

com.valid?
=> true

com.save
=> true

com2.set_translations(“en”=>{“title”=>"",“content”=>“test en”},“it”=>{“title”=>“test it”,“content”=>""})
=> [“it”, “en”]

When I create a new comment the validation is performed (great) but
when I want add another locale to the same comment with the
“set_translations” method in this case the validations is not
performed… is there an issue for this.

After with the web interface I changed the default_locale to :en and I
edited my comment this time in english, in this case also the
validation is performed … ? why the validation can’t be performed
with the “set_translations” method ??

many thanks in advance…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs