问题描述:

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

网友答案:

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.

相关阅读:
Top