i18n for neopets_users#create flashes

This commit is contained in:
Emi Matchu 2013-01-01 22:45:15 -05:00
parent 42320162f0
commit 4c6b43028b
3 changed files with 27 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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