# Translator workplace in Globalize

**URL:** <https://www.ruby-forum.com/t/translator-workplace-in-globalize/73204>\
**Category:** Rails I18n\
**Created:** [October 22, 2006, 9:52pm UTC](https://www.ruby-forum.com/t/translator-workplace-in-globalize/73204 "2006-10-22T21:52:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![azzoti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@azzoti](https://www.ruby-forum.com/u/azzoti)\
**Post date:** [October 22, 2006, 9:52pm UTC](https://www.ruby-forum.com/t/translator-workplace-in-globalize/73204/1 "2006-10-22T21:52:04Z")

</div>

Hello!

I’m going to use Globalize in my app. While playing with Globalize I  
tried translation view example from [globalize-rails.org](http://globalize-rails.org). I like the way  
those things work – text appears in translator’s view (and also in  
globalize\_translations table) after it is first time requested by app.  
Anyway there are some rough edges. Here are the ones that bother me  
more:

1. When a text is requested by application record dedicated to it’s  
translation is put for current language only. My application should use  
only 5 languages and it seem reasonable for me to create empty  
translations for all languages simultaneously.
2. Model translations seem to be created only when such translation is  
saved. I think it will be useful to have empty model translations  
created automatically as view translations or to be created  
simultaneously for all languages after a record in translatable table is  
created.  
My questions are:  
What is supposed/prefered/recomended way to organize translators  
workplace with Globalize? Is it supposed to manage already created  
records in globalize\_translations or it should create records by itself  
based on translatable tables?  
Can described behaviors be achieved using current version of  
Globalize? If not, probably someone could give me some hints of how to  
fix Globalize to work this way?

Tim

---

<div class="post-metadata">

**Author:** ![azzoti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@azzoti](https://www.ruby-forum.com/u/azzoti)\
**Post date:** [October 22, 2006, 11:33pm UTC](https://www.ruby-forum.com/t/translator-workplace-in-globalize/73204/2 "2006-10-22T23:33:30Z")

</div>

Hi Tim,

Your first proposal makes a lot of sense, and should be easier if we  
add a SUPPORTED\_LANGUAGES = [‘en’, ‘es’] type constant. We’re  
thinking of adding something like that anyway for other features.

I didn’t understand your second question. Why do you need to have  
actual records in globalize\_translation for a model if there’s no  
translation for that model in the given language? What’s the  
connection to view translations?

Best,  
Josh

---

<div class="post-metadata">

**Author:** ![azzoti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@azzoti](https://www.ruby-forum.com/u/azzoti)\
**Post date:** [October 23, 2006, 1:43am UTC](https://www.ruby-forum.com/t/translator-workplace-in-globalize/73204/3 "2006-10-23T01:43:33Z")

</div>

Joshua Harvey wrote:

> Hi Tim,
> 
> Your first proposal makes a lot of sense, and should be easier if we  
> add a SUPPORTED\_LANGUAGES = [‘en’, ‘es’] type constant. We’re  
> thinking of adding something like that anyway for other features.  
> Good news 🙂

> I didn’t understand your second question. Why do you need to have  
> actual records in globalize\_translation for a model if there’s no  
> translation for that model in the given language? What’s the  
> connection to view translations?  
> My idea is to create web interface which would allow it’s user to  
> inspect and translate both already translated model data and model data  
> which is supposed to be translated. Easy way is to reproduce example  
> translator logic to work with all texts which appear in  
> globalize\_translations table. That’s the reason I’d like to have empty  
> records in translations table for model data that need to be translated  
> but isn’t translated yet.  
> I see two way of reaching this effect:

1. to load empty translation records for all supported languages when  
new model record is created
2. to load empty records to translations table once corresponding  
model records have been used (it’s the same way it is done with view  
translations).

I’m not sure it’s the best way to organize tranlator’s interface but  
it’s the easiest I think of.  
The other idea is to take records directly from model (instead of  
using globalize\_translations as the only data source) and to save  
translations. Probably it’s the better way. This way it would be good  
idea to be able to get the list of all models and all translatable  
attributes. Is there a way to get it all?

Tim

---

<div class="post-metadata">

**Author:** ![azzoti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@azzoti](https://www.ruby-forum.com/u/azzoti)\
**Post date:** [October 23, 2006, 3:38pm UTC](https://www.ruby-forum.com/t/translator-workplace-in-globalize/73204/4 "2006-10-23T15:38:46Z")

</div>

Hi Tim,

Yes, I’d go with your second idea, pulling the data from the models  
themselves. To get the translatable fields use  
YourModel.globalize\_facets, which will give you an Array of symbols  
representing the field names that are translatable. The method should  
be renamed, but that’s what it is now.

For finding all the models in the app, check out this blog entry:  
[http://sporkmonger.com/articles/2006/10/22/a-question](http://sporkmonger.com/articles/2006/10/22/a-question)

I’ll bet there are better ways of doing it, and probably some of those  
ways are in the Rails code itself, but I don’t know where to point you  
off-hand. Maybe somebody else here does.

– Josh

---

<div class="post-metadata">

**Author:** ![azzoti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@azzoti](https://www.ruby-forum.com/u/azzoti)\
**Post date:** [October 23, 2006, 5:55pm UTC](https://www.ruby-forum.com/t/translator-workplace-in-globalize/73204/5 "2006-10-23T17:55:21Z")

</div>

Hello, Josh!

Thanks for the answers and for Globalize 🙂

Tim
