From 4c6b43028b0e30aa3ec7baa0d41a33cb392517a3 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 1 Jan 2013 22:45:15 -0500 Subject: [PATCH] i18n for neopets_users#create flashes --- app/controllers/neopets_users_controller.rb | 14 +++++--------- config/locales/en-meep.yml | 11 +++++++++++ config/locales/en.yml | 11 +++++++++++ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/controllers/neopets_users_controller.rb b/app/controllers/neopets_users_controller.rb index e9c4fc2d..265ab4f3 100644 --- a/app/controllers/neopets_users_controller.rb +++ b/app/controllers/neopets_users_controller.rb @@ -12,14 +12,9 @@ class NeopetsUsersController < ApplicationController @neopets_user.load! @neopets_user.save_hangers! - message = "Success! We loaded user \"#{@neopets_user.username}\"" - unless @neopets_user.hangers.empty? - message << " and added #{@neopets_user.hangers.size} items." - else - message << ", but already had all of this data recorded." - end - - flash[:success] = message + flash[:success] = t('neopets_users.create.success', + :user_name => @neopets_user.username, + :count => @neopets_user.hangers.size) redirect_to user_closet_hangers_path(current_user) end @@ -30,7 +25,8 @@ class NeopetsUsersController < ApplicationController end def not_found - flash.now[:alert] = "Could not find user \"#{@neopets_user.username}\". Did you spell it correctly?" + flash.now[:alert] = t('neopets_users.create.not_found', + :user_name => @neopets_user.username) render :action => :new end end diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index 8cf00623..cfd6ac30 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -351,6 +351,17 @@ en-meep: concerned, find a meepit and meep out the source code to be sure. neopets_users: + create: + success: + zero: + Okay. We meeped %{user_name}'s pets, but already had these items + meeped to your account. + one: + Success! We meeped %{user_name}'s pets, and meeped 1 item. + other: + Success! We meeped %{user_name}'s pets, and meeped %{count} items. + not_found: Could not meep user %{user_name}. Is it meeped correctly? + new: title: Meemport from pets your_items_link: Back to Your Meeps diff --git a/config/locales/en.yml b/config/locales/en.yml index bde414b8..1a2d443c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -352,6 +352,17 @@ en: be sure. neopets_users: + create: + success: + zero: + Okay. We loaded %{user_name}'s pets, but already had these items + recorded to your account. + one: + Success! We loaded %{user_name}'s pets, and added 1 item. + other: + Success! We loaded %{user_name}'s pets, and added %{count} items. + not_found: Could not find user %{user_name}. Is it spelled correctly? + new: title: Import from pets your_items_link: Back to Your Items