Skip to content

Commit

Permalink
Merge pull request #387 from spark-solutions/otakemaru-i18n-fix
Browse files Browse the repository at this point in the history
Fixed #340
  • Loading branch information
damianlegawiec authored Jun 15, 2017
2 parents 0f2a57b + fd6d285 commit d91d50e
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bg:
unlocks:
send_instructions: До няколко минути ще получите имейл с инструкции как да отключите своя акаунт.
unlocked: Вашият акаунт бе отключен успешно. Вече сте вписани.
passwords:
user_passwords:
spree_user:
cannot_be_blank: Вашата парола не може бъде празна.
no_token: Не можете да достъпите тази страница ако не влезете през мейла за забравена парола.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ de:
unlocks:
send_instructions: In ein paar Minuten erhalten Sie eine E-Mail mit Anweisungen um Ihr Konto freizuschalten.
unlocked: Ihr Konto wurde erfolgreich freigeschaltet.
passwords:
user_passwords:
spree_user:
cannot_be_blank: Ihr Passwort darf nicht leer sein.
send_instructions: In ein paar Minuten erhalten Sie eine E-Mail mit Anweisungen um Ihr Passwort zurücksetzen.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ en:
unlocks:
send_instructions: You will receive an email with instructions about how to unlock your account in a few minutes.
unlocked: Your account was successfully unlocked. You are now signed in.
passwords:
user_passwords:
spree_user:
cannot_be_blank: Your password cannot be blank.
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ es:
unlocks:
send_instructions: Recibirá un email con instrucciones acerca de cómo desbloquear su cuenta en pocos minutos.
unlocked: Su cuenta ha sido desbloqueada correctamente. Ahora está conectado.
passwords:
user_passwords:
spree_user:
cannot_be_blank: La contraseña no puede estar en blanco.
send_instructions: Recibirá un email con instrucciones acerca de como restaurar su contraseña en pocos minutos.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fr:
unlocks:
send_instructions: Vous recevrez dans quelques minutes un courriel avec les instructions sur la façon de déverrouiller votre compte.
unlocked: Votre compte a été déverrouillé. Vous êtes maintenant connecté(e).
passwords:
user_passwords:
spree_user:
cannot_be_blank: Votre mot de passe ne peut pas être vide.
send_instructions: Vous recevrez dans quelques minutes un courriel avec les instructions sur la façon de réinitialiser votre mot de passe.
Expand Down
4 changes: 2 additions & 2 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ it:
omniauth_callbacks:
failure: Non è stato possibile autorizzarti da %{kind} perché "%{reason}".
success: Autorizzato con successo dall'account %{kind}.
passwords:
user_passwords:
no_token: Puoi accedere a questa pagina solamente dalla email di reset della password. Se vieni dalla email controlla di aver inserito l'url completo riportato nella email.
send_instructions: Riceverai un messaggio email con le istruzioni per reimpostare la tua password entro qualche minuto.
send_paranoid_instructions: Se la tua e-mail esiste nel nostro database, riceverai un messaggio email contentente un link per il ripristino della password
Expand All @@ -50,7 +50,7 @@ it:
send_instructions: Riceverai un messaggio email con le istruzioni per sbloccare il tuo account entro qualche minuto.
send_paranoid_instructions: Se la tua e-mail esiste nel nostro database, riceverai un messaggio email con le istruzioni per sbloccare il tuo account entro qualche minuto.
unlocked: Il tuo account è stato correttamente sbloccato. Ora sei collegato.
passwords:
user_passwords:
spree_user:
cannot_be_blank: La tua password non può essere vuota.
send_instructions: Riceverai un'email con le istruzioni per resettare la tua password entro qualche minuto.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nl:
unlocks:
send_instructions: Binnen enkele minuten ontvang je een e-mail om je account te ontgrendelen.
unlocked: Je account is succesvol ontgrendeld. Je bent nu ingelogd.
passwords:
user_passwords:
spree_user:
cannot_be_blank: Je wachtwoord kan niet leeg zijn.
send_instructions: Binnen enkele minuten ontvang je een e-mail met instructies om je wachtwoord te resetten.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pt-BR:
unlocks:
send_instructions: Você receberá um e-mail com instruções sobre como desbloquear sua conta em poucos minutos.
unlocked: Sua conta foi desbloqueada com sucesso. Agora você está conectado.
passwords:
user_passwords:
spree_user:
cannot_be_blank: Sua senha não pode estar em branco.
send_instructions: Você receberá um e-mail com instruções sobre como redefinir sua senha em poucos minutos.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pt:
unlocks:
send_instructions: Receberá um e-mail com as instruções de desbloqueio da sua conta em poucos minutos.
unlocked: A sua conta foi desbloqueada com sucesso. Já se encontra conectado.
passwords:
user_passwords:
spree_user:
cannot_be_blank: A sua senha não pode estar em branco.
send_instructions: Receberá um e-mail com as instruções de redefinição da sua senha em poucos minutos.
Expand Down
2 changes: 1 addition & 1 deletion config/locales/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tr:
unlocks:
send_instructions: Birkaç dakika içinde hesabınızın kilidini nasıl açacağınızı anlatan bir e-posta alacaksınız.
unlocked: Hesabınızın kilidi başarıyla açıldı. Oturumunuz açıldı.
passwords:
user_passwords:
spree_user:
cannot_be_blank: Boş parola giremezsiniz.
send_instructions: Birkaç dakika içinde şifrenizi nasıl yeniden ayarlayacağınızı anlatan bir e-posta alacaksınız.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ def update
end
end

protected

def translation_scope
'devise.user_passwords'
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def create
def authorization_failure
end

protected

def translation_scope
'devise.user_sessions'
end

private
def accurate_title
Spree.t(:login)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ class Spree::UserConfirmationsController < Devise::ConfirmationsController
def after_confirmation_path_for(resource_name, resource)
signed_in?(resource_name) ? signed_in_root_path(resource) : spree.login_path
end

def translation_scope
'devise.confirmations'
end

end
4 changes: 4 additions & 0 deletions lib/controllers/frontend/spree/user_passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def update

protected

def translation_scope
'devise.user_passwords'
end

def new_session_path(resource_name)
spree.send("new_#{resource_name}_session_path")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def check_permissions
authorize!(:create, resource)
end

def translation_scope
'devise.user_registrations'
end

private

def spree_user_params
Expand Down
6 changes: 6 additions & 0 deletions lib/controllers/frontend/spree/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def create
end
end

protected

def translation_scope
'devise.user_sessions'
end

private
def accurate_title
Spree.t(:login)
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/spree/user_passwords_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
spree_put :update, { spree_user: { password: '', password_confirmation: '', reset_password_token: token } }
expect(assigns(:spree_user).kind_of?(Spree::User)).to eq true
expect(assigns(:spree_user).reset_password_token).to eq token
expect(flash[:error]).to eq I18n.t(:cannot_be_blank, scope: [:devise, :passwords, :spree_user])
expect(flash[:error]).to eq I18n.t(:cannot_be_blank, scope: [:devise, :user_passwords, :spree_user])
expect(response).to render_template :edit
end
end
Expand Down

0 comments on commit d91d50e

Please sign in to comment.