joaomdmoura / gioco

A gamification gem to Ruby on Rails applications
305 stars 36 forks source link

i18n to levels and badges #70

Open marceloboeira opened 9 years ago

marceloboeira commented 9 years ago

I guess it would be nice to be able to apply different names to different badges, levels... so, I guess a simple method on the badges and levels that can return a translated version.

in badge.rb

def name(translated)
   translated ? I18n(:"badges.#{name}") : name
end 

in level.rb

def name(translated)
   translated ? I18n(:"levels.#{name}") : name
end 

I can try to code this and open a pull request soon!

joaomdmoura commented 9 years ago

Hey @marceloboeira great suggestion! Would be great to receive a PR on this! make yourself comfortable! :+1: