split I18n into sperate files

382 views Asked by At

one of the requirement is to split I18n. I have been looking into the link below in section organization of local files

http://guides.rubyonrails.org/i18n.html

If I look at the config/locales/en-US.yml in my project I dont see anything for model, view or controller. I see the data about the items of the webpage. en-US.yml looks like this

en-US:
Healthe:
 Points:
   my_points: "Point %{unit}"
   status: "Points achieved"

Am I looking at wrong file? How do i split i18n for model, views and controller that has translation?

1

There are 1 answers

0
Dhymas Josue Acuña Rocha On

In this file will be all the translations of the language by default (en). If you need to change the messages then you must first implement an .yml file that the community already has prepared in this direction Locales. Then you have to download the file you need (en-US.yml) and put it in the address config/locales/en-US.yml and add or edit the messages you want. Then you have to edit the configuration of your application and put the one you want (es-ES), for this you have to create a file in config/initializers/language.rb and inside

Rails.application.config.i18n.default_locale = 'es-US'