forked from OpenNeo/impress
pet states know their localized description
This commit is contained in:
parent
9efd2fe83a
commit
5985e234da
4 changed files with 37 additions and 4 deletions
2
Gemfile
2
Gemfile
|
@ -39,7 +39,7 @@ gem 'sanitize', '~> 2.0.3'
|
|||
|
||||
gem 'newrelic_rpm'
|
||||
|
||||
gem 'neopets', :git => 'git://github.com/matchu/neopets.git'
|
||||
gem 'neopets', '~> 0.2.0', :git => 'git://github.com/matchu/neopets.git'
|
||||
|
||||
gem "mini_magick", "~> 3.4"
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/matchu/neopets.git
|
||||
revision: d33aaf63d4617d9236ef0d99452b3bdc577cbc8e
|
||||
revision: 5d13a720b616ba57fbbd54541f3e5daf02b3fedc
|
||||
specs:
|
||||
neopets (0.1.0)
|
||||
neopets (0.2.0)
|
||||
nokogiri (~> 1.5.2)
|
||||
|
||||
GIT
|
||||
|
@ -301,7 +301,7 @@ DEPENDENCIES
|
|||
msgpack (~> 0.4.3)
|
||||
mysql2 (< 0.3)
|
||||
mysqlplus!
|
||||
neopets!
|
||||
neopets (~> 0.2.0)!
|
||||
newrelic_rpm
|
||||
nokogiri (~> 1.5.2)
|
||||
openneo-auth-signatory (~> 0.1.0)
|
||||
|
|
|
@ -103,6 +103,27 @@ class PetState < ActiveRecord::Base
|
|||
def mood
|
||||
Neopets::Pet::Mood.find(self.mood_id)
|
||||
end
|
||||
|
||||
def gender_name
|
||||
if female?
|
||||
I18n.translate("pet_states.description.gender.female")
|
||||
else
|
||||
I18n.translate("pet_states.description.gender.male")
|
||||
end
|
||||
end
|
||||
|
||||
def mood_name
|
||||
I18n.translate("pet_states.description.mood.#{mood.name}")
|
||||
end
|
||||
|
||||
def gender_mood_description
|
||||
if labeled?
|
||||
I18n.translate('pet_states.description.main', :gender => gender_name,
|
||||
:mood => mood_name)
|
||||
else
|
||||
I18n.translate('pet_states.description.unlabeled')
|
||||
end
|
||||
end
|
||||
|
||||
def self.from_pet_type_and_biology_info(pet_type, info)
|
||||
swf_asset_ids = []
|
||||
|
|
|
@ -706,6 +706,18 @@ en:
|
|||
clone: Edit a copy
|
||||
creation_summary_html: Created by %{user_link}, %{created_at_ago} ago
|
||||
|
||||
pet_states:
|
||||
description:
|
||||
main: "%{mood} %{gender}"
|
||||
gender:
|
||||
female: Female
|
||||
male: Male
|
||||
mood:
|
||||
happy: Happy
|
||||
sad: Sad
|
||||
sick: Sick
|
||||
unlabeled: Unlabeled
|
||||
|
||||
pets:
|
||||
bulk:
|
||||
needed_items:
|
||||
|
|
Loading…
Reference in a new issue