Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devises I18n #1699

Closed
nortcele opened this issue Mar 5, 2012 · 8 comments
Closed

Devises I18n #1699

nortcele opened this issue Mar 5, 2012 · 8 comments

Comments

@nortcele
Copy link

nortcele commented Mar 5, 2012

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

@josevalim
Copy link
Contributor

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.

@nortcele
Copy link
Author

nortcele commented Mar 5, 2012

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

Yours

@mikdiet
Copy link

mikdiet commented May 26, 2012

@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!

@myabc
Copy link

myabc commented Oct 21, 2012

+1

@johnnyshields
Copy link

+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.

@josevalim
Copy link
Contributor

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.

@johnnyshields
Copy link

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

@josevalim
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants