Permalink
Browse files

Migrate `retweet` task to locale.

  • Loading branch information...
amerine committed May 28, 2012
1 parent 20602c4 commit f623c9ab934cda46bfc92aa6d205f8e91be3c3b7
Showing with 12 additions and 3 deletions.
  1. +5 −3 lib/t/cli.rb
  2. +7 −0 lib/t/locales/en.yml
View
@@ -642,7 +642,7 @@ def report_spam(user, *users)
end
map %w(report reportspam spam) => :report_spam
- desc "retweet STATUS_ID [STATUS_ID...]", "Sends Tweets to your followers."
+ desc "retweet STATUS_ID [STATUS_ID...]", I18n.t("tasks.retweet.desc")
def retweet(status_id, *status_ids)
status_ids.unshift(status_id)
status_ids.map!(&:to_i)
@@ -654,9 +654,11 @@ def retweet(status_id, *status_ids)
end
end
number = retweets.length
- say "@#{@rcfile.active_profile[0]} retweeted #{number} #{number == 1 ? 'tweet' : 'tweets'}."
+ say I18n.t("tasks.retweet.retweeted", :profile => @rcfile.active_profile[0], :count => number)
say
- say "Run `#{File.basename($0)} delete status #{retweets.map(&:id).join(' ')}` to undo."
+ say I18n.t("tasks.retweet.delete-instructions",
+ :command_name => File.basename($0),
+ :retweets => retweets.map(&:id).join(' '))
end
map %w(rt) => :retweet
View
@@ -133,3 +133,10 @@ en:
reported:
one: "@%{profile} reported 1 user."
other: "@%{profile} reported %{count} users."
+
+ retweet:
+ desc: "Sends Tweets to your followers."
+ retweeted:
+ one: "@%{profile} retweeted 1 tweet."
+ other: "@%{profile} retweeted %{count} tweet."
+ delete-instructions: "Run `%{command_name} delete status %{retweets}` to undo."

0 comments on commit f623c9a

Please sign in to comment.