# Complex folder estructure inside locale translated

**URL:** <https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772>\
**Category:** Rails I18n\
**Created:** [June 7, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772 "2010-06-07T15:03:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 7, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/1 "2010-06-07T15:03:47Z")

</div>

Hello I’ve been watching these two projects [1] and [2]. Both look good.  
But  
I see it is not possible to have a complex structure inside the locale  
folder.

The two projects caught the .yml and displayed in a web interface for  
ease  
translate each string.

But with a Base of folders a bit complex. Example:

locale  
|-es.yml  
|-models  
|-users  
|-es.yml  
|-articles  
|-es.yml  
|-views  
|-users  
|–articles  
formtastic  
|-es.yml

It is possible to translate this. Or should I put all the strings in a  
single file?

[1] [http://github.com/newsdesk/translate](http://github.com/newsdesk/translate)  
[2] [http://github.com/dhh/tolk](http://github.com/dhh/tolk)

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 12:46pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/2 "2010-06-08T12:46:23Z")

</div>

On Jun 7, 3:02 pm, Andrés gutiérrez [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> |-es.yml
> 
> It is possible to translate this. Or should I put all the strings in a  
> single file?
> 
> [1][http://github.com/newsdesk/translate](http://github.com/newsdesk/translate)  
> [2][http://github.com/dhh/tolk](http://github.com/dhh/tolk)

Please, Does anyone else separated into folders or am I the only one?

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 1:13pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/3 "2010-06-08T13:13:19Z")

</div>

Hi,

I don’t really know what to do. Both using many files and one single  
file have their advantages and disadvantages. One file can get a big  
mess, but many files are hard to find stuff.

Sometimes I wish the scopes were all backwards: Then you would be able  
to group translations together based upon their functionality instead  
of their usage.

I don’t use any of these projects yet, but I am going to use tolk in  
the near future, so I can’t say anything about that yet.

- iain

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 1:27pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/4 "2010-06-08T13:27:57Z")

</div>

El 8 de junio de 2010 13:25, AndrÃ©s gutiÃ©rrez  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)escribiÃ³:

> > Sometimes I wish the scopes were all backwards: Then you would be able  
> > to group translations together based upon their functionality instead  
> > of their usage.
> > 
> > I don’t use any of these projects yet, but I am going to use tolk in  
> > the near future, so I can’t say anything about that yet.
> 
> Thanks Ian for the reply. I see it is a question that not only do I have  
> right?

Sorry Iain no Ian

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 1:27pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/5 "2010-06-08T13:27:22Z")

</div>

2010/6/8 Iain H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> I don’t use any of these projects yet, but I am going to use tolk in  
> the near future, so I can’t say anything about that yet.

Thanks Ian for the reply. I see it is a question that not only do I have  
right?

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 2:53pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/6 "2010-06-08T14:53:26Z")

</div>

We had this discussion at my company. Nobody really knew what to do.  
Does anybody else have the problem?

-iain

2010/6/8 Andrés gutiérrez [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 3:50pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/7 "2010-06-08T15:50:18Z")

</div>

Hi,

At my company we made a web application that does just that.

> **[Software translation and project management · WebTranslateIt](https://webtranslateit.com/)**
>
> WebTranslateIt is a software localization tool for developers. Includes a project management tool and a translation tool in an easy to use web-based software.

It’s a commercial software. We are working with companies having  
projects with several hundreds of deeply nested language files, so  
this kind of scenario was a requirement.  
You can read in the documentation how it handles complex file  
structures.

[http://docs.webtranslateit.com/file\_manager/#file\_structure](http://docs.webtranslateit.com/file_manager/#file_structure)

Regards,  
Édouard

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 4:07pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/8 "2010-06-08T16:07:52Z")

</div>

2010/6/8 Edouard [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> structures.
> 
> [http://docs.webtranslateit.com/file\_manager/#file\_structure](http://docs.webtranslateit.com/file_manager/#file_structure)
> 
> Regards,  
> Ã‰douard

Thanks Ã‰douard, looks great, but mine is a personal and no comercial  
project. And i would like to manage this problem localy…in this moment

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [June 8, 2010, 4:19pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/9 "2010-06-08T16:19:00Z")

</div>

El 8 de junio de 2010 16:06, AndrÃ©s gutiÃ©rrez  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)escribiÃ³:

> > Itâ€™s a commercial software. We are working with companies having
> 
> Thanks Ã‰douard, looks great, but mine is a personal and no comercial  
> project. And i would like to manage this problem localy…in this moment
> 
> > Sorry i’m reading more. And wti is more powerful 😮 [1]

Thanks

[1] [http://docs.webtranslateit.com/ruby\_on\_rails/](http://docs.webtranslateit.com/ruby_on_rails/)

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [July 17, 2010, 5:19pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/10 "2010-07-17T17:19:46Z")

</div>

I also keep my English locale in several files, but I don’t really need  
to  
aggregate them to import it to Tolk. When I run tolk:sync it seems to  
read  
all my .yml files inside config/locales.

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [July 18, 2010, 10:46pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/11 "2010-07-18T22:46:10Z")

</div>

El 17 de julio de 2010 17:18, AndrÃ©s MejÃ­a [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) escribiÃ³:

> I also keep my English locale in several files, but I don’t really need to  
> aggregate them to import it to Tolk. When I run tolk:sync it seems to read  
> all my .yml files inside config/locales.
> 
> Thanks guys! this a recurrent problem for me. I’ll try your suggestions.

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [August 14, 2010, 9:50pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/12 "2010-08-14T21:50:35Z")

</div>

2010/7/17 Tokumine [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Hey there - I manage my base local in nested directories, and then  
> aggregate into a top level en.yml that I send off to tolk for  
> translation. Keeping my base locale in nested directories and my  
> translations at the top level is working well.
> 
> Here’s a write up with a rake task to aggregate your base locales:  
> [http://www.tokumine.com/2010/07/16/using-split-locale-files-with-tolk/](http://www.tokumine.com/2010/07/16/using-split-locale-files-with-tolk/)

I’m trying this, this is my rake task [1] but dosn’t work  
What i’m doing bad?

[1] [http://www.pastie.org/1092435](http://www.pastie.org/1092435)

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [July 17, 2010, 2:33pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/13 "2010-07-17T14:33:33Z")

</div>

Hey there - I manage my base local in nested directories, and then  
aggregate into a top level en.yml that I send off to tolk for  
translation. Keeping my base locale in nested directories and my  
translations at the top level is working well.

Here’s a write up with a rake task to aggregate your base locales:  
[http://www.tokumine.com/2010/07/16/using-split-locale-files-with-tolk/](http://www.tokumine.com/2010/07/16/using-split-locale-files-with-tolk/)

Si

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [August 14, 2010, 11:18pm UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/14 "2010-08-14T23:18:23Z")

</div>

I don’t really think you need that rake task. I split my English locale  
into  
several files, like this:

[image: 20100814-899ktjfem9fqe2ia8dgjxq8hrb.png]

When I run rake tolk:sync or rake tolk:import it automatically picks all  
my  
English files without doing anything else. The fr.yml locale you see in  
the  
screenshot was generated using rake tolk:dump\_all.

2010/8/14 AndrÃ©s gutiÃ©rrez [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![andresgutgon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@andresgutgon](https://www.ruby-forum.com/u/andresgutgon)\
**Post date:** [August 15, 2010, 11:28am UTC](https://www.ruby-forum.com/t/complex-folder-estructure-inside-locale-translated/189772/15 "2010-08-15T11:28:08Z")

</div>

El 14 de agosto de 2010 23:16, AndrÃ©s MejÃ­a [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) escribiÃ³:

> I don’t really think you need that rake task. I split my English locale  
> into several files, like this:
> 
> [image: 20100814-899ktjfem9fqe2ia8dgjxq8hrb.png]
> 
> When I run rake tolk:sync or rake tolk:import it automatically picks all  
> my English files without doing anything else. The fr.yml locale you see in  
> the screenshot was generated using rake tolk:dump\_all.

That is correct. I have a similar estructure, but my problem is with  
default rails locale files [1]

I downloaded ca.yml and en.yml and bouth are in /locale/defaults  
When i run rake tolk:import This task don’t find this files. So i need  
to  
merge this files with the root files (ca.yml and en.yml) generated by  
Tolk

[1] [GitHub - svenfuchs/rails-i18n: Repository for collecting Locale data for Ruby on Rails I18n as well as other interesting, Rails related I18n stuff · GitHub](http://github.com/svenfuchs/rails-i18n)
