# Split the en.yml into multiple files?

**URL:** <https://www.ruby-forum.com/t/split-the-en-yml-into-multiple-files/188779>\
**Category:** Rails\
**Created:** [May 18, 2010, 12:19pm UTC](https://www.ruby-forum.com/t/split-the-en-yml-into-multiple-files/188779 "2010-05-18T12:19:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@lukas](https://www.ruby-forum.com/u/lukas)\
**Post date:** [May 18, 2010, 12:19pm UTC](https://www.ruby-forum.com/t/split-the-en-yml-into-multiple-files/188779/1 "2010-05-18T12:19:41Z")

</div>

Hello,

I have a problem with my en.yml file in my Rails project: It’s getting  
waaaaay too big.  
Is it possible to split the file up into multiple files, like  
en\_labels.yml, en\_hints.yml and so forth?

I couldn’t find anything so far…

Cheers  
L.

---

<div class="post-metadata">

**Author:** ![lukas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@lukas](https://www.ruby-forum.com/u/lukas)\
**Post date:** [May 18, 2010, 12:48pm UTC](https://www.ruby-forum.com/t/split-the-en-yml-into-multiple-files/188779/2 "2010-05-18T12:48:57Z")

</div>

On May 18, 11:17 am, lukas [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,
> 
> I have a problem with my en.yml file in my Rails project: It’s getting  
> waaaaay too big.  
> Is it possible to split the file up into multiple files, like  
> en\_labels.yml, en\_hints.yml and so forth?

Take a look at

> **[Rails Internationalization (I18n) API — Ruby on Rails Guides](https://guides.rubyonrails.org/i18n.html#organization-of-locale-files)**
>
> Rails Internationalization (I18n) APIThe Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single...

Fred

---

<div class="post-metadata">

**Author:** ![lukas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@lukas](https://www.ruby-forum.com/u/lukas)\
**Post date:** [May 18, 2010, 12:54pm UTC](https://www.ruby-forum.com/t/split-the-en-yml-into-multiple-files/188779/3 "2010-05-18T12:54:13Z")

</div>

Ah great, thanks. I just realized it works when I simply split them up  
like this:

en\_forms.yml  
en\_labels.yml  
etc.

however,

will rails automatically know which one to pic if I f.example add  
french like this:

fr\_forms.yml  
fr\_labels.yml

?

Or do I have to work with the directory structure as described in your  
link?

On May 18, 12:47 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![lukas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@lukas](https://www.ruby-forum.com/u/lukas)\
**Post date:** [May 18, 2010, 1:05pm UTC](https://www.ruby-forum.com/t/split-the-en-yml-into-multiple-files/188779/4 "2010-05-18T13:05:20Z")

</div>

On May 18, 11:52 am, lukas [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> french like this:
> 
> fr\_forms.yml  
> fr\_labels.yml

My understanding is that rails doesn’t care in the slightest what the  
files are called, it’s only the data in side that matters ie putting

en:  
title: ‘Hello world’

in fr.yml

and

fr:  
title: ‘Bonjour’

in en.yml  
would be fine (although rather confusing)

Fred

---

<div class="post-metadata">

**Author:** ![lukas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@lukas](https://www.ruby-forum.com/u/lukas)\
**Post date:** [May 18, 2010, 1:38pm UTC](https://www.ruby-forum.com/t/split-the-en-yml-into-multiple-files/188779/5 "2010-05-18T13:38:42Z")

</div>

Yes, I think you’re right about the meaninglessness of the filename.

Okay, another problem solved.  
Thanks, Fred! 🙂

On May 18, 1:03 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
