refactored I18 enforce_available_locales method to support Rails 3.2.x

Simply refactor to support older versions of Rails.