heartcombo/devise

Devises I18n

nortcele opened this issue · 8 comments

I internationalized Devise's views. What is the best way to submit my work?

Thank you for your interest in contributing to Devise but we have decided to not have internationalized views within Devise since they make it harder for people that do not need an internationalized application (which are the majority of the cases) to maintain their view.

In case someone need it it could be found at "git://github.com/nortcele/devise.git".

Yours

@josevalim It's not clear decision, because we already have file config/locales/devise.en.yml for flash messages, and i18n is a part of Rails. Rewriting devise's views at application level each time is awful!

+1

+1

Is there any reason we can't be make the views internationalized, then add a flag to the generator task --locale :en which would pre-parse them with a hardcoded language?

It seems that Devise is going against the trend of the community to have commonly used gems internalized, including Rails itself.

I'm using https://github.com/mcasimir/devise-i18n-views for now.

It seems that Devise is going against the trend of the community to have commonly used gems internalized, including Rails itself.

This sentence is misleading. Does Rails scaffold generate files containing t() translations in it? It doesn't.

Devise supports I18n since day one: flash messages, helpers, models and so on. We just don't ship views with the t helper but you can still achieve it easily as you said yourself.

But Devise is not going to make it harder for people that do not need an internationalized application (which are the majority of the cases) to maintain their view by inserting the t helper needlessly.

Is the following worth considering (which could give the best of both worlds):

rails generate devise:views
# same as current behavior -- outputs views with hardcoded text 
# by pre-parsing t() calls based on :en locale

rails generate devise:views:i18n
# outputs views with t() included, and creates /config/locales/devise.en.yml

There are already gems that do it. We are not particularly looking for more code to maintain. :)