From 42320162f06af7df8e9a02f9c4338ab29195be03 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 1 Jan 2013 22:34:30 -0500 Subject: [PATCH] i18n for users#index, users#update flashes --- app/controllers/users_controller.rb | 7 ++++--- config/locales/en-meep.yml | 7 +++++++ config/locales/en.yml | 7 +++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e8b69d32..b542d502 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -7,7 +7,7 @@ class UsersController < ApplicationController if @user redirect_to user_closet_hangers_path(@user) 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 end end @@ -21,10 +21,11 @@ class UsersController < ApplicationController respond_to do |format| format.html { if success - flash[:success] = "Settings successfully saved" + flash[:success] = t('users.update.success') redirect_back! user_closet_hangers_path(@user) 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 } diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index aea8ad42..8cf00623 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -420,8 +420,15 @@ en-meep: submission_success: "%{points} peeps" users: + index: + not_found: We don't have a meepit named %{name}. Is it meeped correctly? + top_contributors: title: Top Conmeeputors rank: Reep user: Meepit points: Peeps + + update: + success: Settings successfully meeped. + invalid: "Could not meep settings: %{errors}" diff --git a/config/locales/en.yml b/config/locales/en.yml index 18a5fa9f..bde414b8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -422,8 +422,15 @@ en: submission_success: "%{points} points" users: + index: + not_found: We don't have a user named %{name}. Is it spelled correctly? + top_contributors: title: Top Contributors rank: Rank user: User points: Points + + update: + success: Settings successfully saved. + invalid: "Could not save settings: %{errors}"