def status(short=false)
output = []
if self.core_length > 0
if short
output << n_("%{count} core module loaded", "%{count} core modules loaded",
self.core_length) % {:count => self.core_length}
else
output << n_("%{count} core module: %{list}",
"%{count} core modules: %{list}", self.core_length) %
{ :count => self.core_length,
:list => core_modules.collect{ |p| p.name}.sort.join(", ") }
end
else
output << _("no core botmodules loaded")
end
if(self.length > 0)
if short
output << n_("%{count} plugin loaded", "%{count} plugins loaded",
self.length) % {:count => self.length}
else
output << n_("%{count} plugin: %{list}",
"%{count} plugins: %{list}", self.length) %
{ :count => self.length,
:list => plugins.collect{ |p| p.name}.sort.join(", ") }
end
else
output << "no plugins active"
end
unless @ignored.empty? or @failures_shown
if short
output << n_("%{highlight}%{count} plugin ignored%{highlight}",
"%{highlight}%{count} plugins ignored%{highlight}",
@ignored.length) %
{ :count => @ignored.length, :highlight => Underline }
else
output << n_("%{highlight}%{count} plugin ignored%{highlight}: use %{bold}%{command}%{bold} to see why",
"%{highlight}%{count} plugins ignored%{highlight}: use %{bold}%{command}%{bold} to see why",
@ignored.length) %
{ :count => @ignored.length, :highlight => Underline,
:bold => Bold, :command => "help ignored plugins"}
end
end
unless @failed.empty? or @failures_shown
if short
output << n_("%{highlight}%{count} plugin failed to load%{highlight}",
"%{highlight}%{count} plugins failed to load%{highlight}",
@failed.length) %
{ :count => @failed.length, :highlight => Reverse }
else
output << n_("%{highlight}%{count} plugin failed to load%{highlight}: use %{bold}%{command}%{bold} to see why",
"%{highlight}%{count} plugins failed to load%{highlight}: use %{bold}%{command}%{bold} to see why",
@failed.length) %
{ :count => @failed.length, :highlight => Reverse,
:bold => Bold, :command => "help failed plugins"}
end
end
output.join '; '
end