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

**URL:** <https://www.ruby-forum.com/t/how-build-two-translated-model-in-the-same-time-with-globalize2/182053>\
**Category:** Rails I18n\
**Created:** [January 22, 2010, 12:16am UTC](https://www.ruby-forum.com/t/how-build-two-translated-model-in-the-same-time-with-globalize2/182053 "2010-01-22T00:16:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnette31](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Arnette31](https://www.ruby-forum.com/u/Arnette31)\
**Post date:** [January 22, 2010, 12:16am UTC](https://www.ruby-forum.com/t/how-build-two-translated-model-in-the-same-time-with-globalize2/182053/1 "2010-01-22T00:16:40Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Arnette31](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Arnette31](https://www.ruby-forum.com/u/Arnette31)\
**Post date:** [January 22, 2010, 5:22pm UTC](https://www.ruby-forum.com/t/how-build-two-translated-model-in-the-same-time-with-globalize2/182053/2 "2010-01-22T17:22:10Z")

</div>

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…
