Any solution for this? I'm seeing the same errors.

rb
On Saturday, November 17, 2012 3:30:02 AM UTC-6, Emyl wrote:

Hi,

While working on a localized Spree project, I noticed that even using
spree_i18n not all flash messages are localized. I'm using
spree_auth_devise for authentication.

From what I understand, for some actions like "sign out" the message is
stored under spree_auth_devise locale files, under a key named
devise.user_sessions.user.signed_out. I think this is because the sign
out action resides in a subclass of Devise::SessionController, called
UserSessions. Devise by default looks for a key with scope
devise.#{controller_name}, which in this case correspond to the name of
that subclass.

I started looking for a solution which could allow me to reuse existing
localization files from devise, without rewriting them under
spree_auth_devise. Looking in devise source code, I saw that default key
options could be overridden defining a method named devise_i18n_options.
I've done that, modifying the scope to be devise.#{parent_name}, where
parent_name is the name of the superclass (lowercase and separated by
underscores like controller_name). Now I can rely on devise localizations
for all flash messages previously handled by spree_auth_devise.

I'm asking an opinion to this approach. IMHO it could be useful for two
reasons: first of all it allows to reuse existing devise stuff, and also it
removes some complexity: spree localizations under spree_i8n gem, and
devise localizations under devise gem. No other source.

If someone from Spree agree with my opinion, I'll be happy to work on a
pull request with tests and all the rest.

Thanks in advance for all feedbacks.
Emyl
--

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedJan 25, '13 at 10:11p
activeJan 25, '13 at 10:11p
posts1
users1
websitespreecommerce.com
irc#RubyOnRails

1 user in discussion

Randy Burgess: 1 post

People

Translate

site design / logo © 2022 Grokbase