refactored I18 enforce_available_locales method to support Rails 3.2.x