also internationalize home controller
This commit is contained in:
parent
1860e1c4cc
commit
9138f0da03
4 changed files with 12 additions and 5 deletions
|
@ -16,7 +16,7 @@ class HomeController < ApplicationController
|
|||
|
||||
def update_profile
|
||||
if @current_user.update_attributes(params[:user])
|
||||
redirect_to my_profile_url, notice: 'Änderungen wurden gespeichert.'
|
||||
redirect_to my_profile_url, notice: I18n.t('home.changes_saved')
|
||||
else
|
||||
render :profile
|
||||
end
|
||||
|
@ -45,7 +45,7 @@ class HomeController < ApplicationController
|
|||
@financial_transactions = @financial_transactions.where("note LIKE ?", "%#{params[:query]}%") if params[:query].present?
|
||||
|
||||
else
|
||||
redirect_to root_path, :alert => "Leider bist Du kein Mitglied einer Bestellgruppe"
|
||||
redirect_to root_path, :alert => I18n.t('home.no_ordergroups')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -54,9 +54,9 @@ class HomeController < ApplicationController
|
|||
membership = Membership.find(params[:membership_id])
|
||||
if membership.user == current_user
|
||||
membership.destroy
|
||||
flash[:notice] = "Du bist jetzt kein Mitglied der Gruppe #{membership.group.name} mehr."
|
||||
flash[:notice] = I18n.t('home.ordergroup_cancelled', :group => membership.group.name)
|
||||
else
|
||||
flash[:error] = "Ein Problem ist aufgetreten."
|
||||
flash[:error] = I18n.t('errors.general')
|
||||
end
|
||||
redirect_to my_profile_path
|
||||
end
|
||||
|
|
|
@ -119,6 +119,7 @@ de:
|
|||
second: Sekunden
|
||||
year: Jahr
|
||||
errors: &errors
|
||||
general: 'Ein Problem ist aufgetreten.'
|
||||
format: ! '%{attribute} %{message}'
|
||||
messages:
|
||||
accepted: muss akzeptiert werden
|
||||
|
|
|
@ -78,3 +78,8 @@ de:
|
|||
cancel: 'Mitgliedschaft beenden'
|
||||
cancel_confirm: 'Bist Du sicher, dass Du Deine Mitgliedschaft beenden willst?'
|
||||
|
||||
# used by controller
|
||||
changes_saved: 'Änderungen wurden gespeichert.'
|
||||
no_ordergroups: 'Leider bist Du kein Mitglied einer Bestellgruppe'
|
||||
ordergroup_cancelled: 'Du bist jetzt kein Mitglied der Gruppe %{group} mehr.'
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ en:
|
|||
second: seconds
|
||||
year: years
|
||||
errors: &errors
|
||||
general: 'A problem has occured.'
|
||||
format: ! '%{attribute} %{message}'
|
||||
messages:
|
||||
accepted: has to be accepted
|
||||
|
|
Loading…
Reference in a new issue