Skip to content

Commit

Permalink
Migrate report_spam task to locale.
Browse files Browse the repository at this point in the history
  • Loading branch information
amerine committed May 28, 2012
1 parent 531077e commit 20602c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/t/cli.rb
Expand Up @@ -620,8 +620,8 @@ def reply(status_id, message)
say I18n.t("tasks.reply.delete-instructions", :command_name => File.basename($0), :reply_id => reply.id)
end

desc "report_spam USER [USER...]", "Report users for spam."
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify input as Twitter user IDs instead of screen names."
desc "report_spam USER [USER...]", I18n.t("tasks.report_spam.desc")
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => I18n.t("tasks.report_spam.id")
def report_spam(user, *users)
users.unshift(user)
require 't/core_ext/string'
Expand All @@ -638,7 +638,7 @@ def report_spam(user, *users)
end
end
number = users.length
say "@#{@rcfile.active_profile[0]} reported #{number} #{number == 1 ? 'user' : 'users'}."
say I18n.t("tasks.report_spam.reported", :profile => @rcfile.active_profile[0], :count => number)
end
map %w(report reportspam spam) => :report_spam

Expand Down
7 changes: 7 additions & 0 deletions lib/t/locales/en.yml
Expand Up @@ -126,3 +126,10 @@ en:
all: "Reply to all users mentioned in the Tweet."
posted: "Reply posted by @%{profile} to %{users}."
delete-instructions: "Run `%{command_name} delete status %{reply_id}` to delete."

report_spam:
desc: "Report users for spam."
id: "Specify input as Twitter user IDs instead of screen names."
reported:
one: "@%{profile} reported 1 user."
other: "@%{profile} reported %{count} users."

0 comments on commit 20602c4

Please sign in to comment.