Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: How to generate translation files like django

I am trying to use internationalization in rails. Here i've found that for the command

<%= t :hello_world %>

I know that Ineed to define :hello_world in the file config/locales/en.yml like this

# config/locales/en.yml
en:
  hello_world: Hello world!

What i want to know is as in django it generates translation files using makemessages, is there any way to do it in rails? It becomes a tedious task to find and write whole translations.

Thanks

like image 586
Paritosh Singh Avatar asked Nov 04 '22 15:11

Paritosh Singh


1 Answers

You might consider checking https://github.com/svenfuchs/i18n-missing_translations that provides a way to build a yml with missing translations keys while you browse your application.

Wiring it when you run your tests should yielld all missing translations if you have exhaustive coverage.

It doesn't seem as slick as Django's makemessages is, but it's a start.

like image 131
jhchabran Avatar answered Nov 15 '22 04:11

jhchabran