i18n for users#index, users#update flashes
This commit is contained in:
parent
9c7ddd55a4
commit
42320162f0
3 changed files with 18 additions and 3 deletions
|
@ -7,7 +7,7 @@ class UsersController < ApplicationController
|
||||||
if @user
|
if @user
|
||||||
redirect_to user_closet_hangers_path(@user)
|
redirect_to user_closet_hangers_path(@user)
|
||||||
else
|
else
|
||||||
flash[:alert] = "We don't have a user named \"#{name}\". Did you spell it correctly?"
|
flash[:alert] = t('users.index.not_found', :name => name)
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -21,10 +21,11 @@ class UsersController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
if success
|
if success
|
||||||
flash[:success] = "Settings successfully saved"
|
flash[:success] = t('users.update.success')
|
||||||
redirect_back! user_closet_hangers_path(@user)
|
redirect_back! user_closet_hangers_path(@user)
|
||||||
else
|
else
|
||||||
flash[:alert] = "Error saving user settings: #{@user.errors.full_messages.to_sentence}"
|
flash[:alert] = t('users.update.invalid',
|
||||||
|
:errors => @user.errors.full_messages.to_sentence)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -420,8 +420,15 @@ en-meep:
|
||||||
submission_success: "%{points} peeps"
|
submission_success: "%{points} peeps"
|
||||||
|
|
||||||
users:
|
users:
|
||||||
|
index:
|
||||||
|
not_found: We don't have a meepit named %{name}. Is it meeped correctly?
|
||||||
|
|
||||||
top_contributors:
|
top_contributors:
|
||||||
title: Top Conmeeputors
|
title: Top Conmeeputors
|
||||||
rank: Reep
|
rank: Reep
|
||||||
user: Meepit
|
user: Meepit
|
||||||
points: Peeps
|
points: Peeps
|
||||||
|
|
||||||
|
update:
|
||||||
|
success: Settings successfully meeped.
|
||||||
|
invalid: "Could not meep settings: %{errors}"
|
||||||
|
|
|
@ -422,8 +422,15 @@ en:
|
||||||
submission_success: "%{points} points"
|
submission_success: "%{points} points"
|
||||||
|
|
||||||
users:
|
users:
|
||||||
|
index:
|
||||||
|
not_found: We don't have a user named %{name}. Is it spelled correctly?
|
||||||
|
|
||||||
top_contributors:
|
top_contributors:
|
||||||
title: Top Contributors
|
title: Top Contributors
|
||||||
rank: Rank
|
rank: Rank
|
||||||
user: User
|
user: User
|
||||||
points: Points
|
points: Points
|
||||||
|
|
||||||
|
update:
|
||||||
|
success: Settings successfully saved.
|
||||||
|
invalid: "Could not save settings: %{errors}"
|
||||||
|
|
Loading…
Reference in a new issue