From 74c14cc87ed58fd88acd4898372e017ebe1bbaa3 Mon Sep 17 00:00:00 2001 From: Raine Virta Date: Mon, 2 Mar 2009 04:04:35 +0200 Subject: hangman: enable gettext on some replies and help --- data/rbot/plugins/games/hangman.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'data/rbot/plugins/games/hangman.rb') diff --git a/data/rbot/plugins/games/hangman.rb b/data/rbot/plugins/games/hangman.rb index dbabb72c..c5d7656f 100644 --- a/data/rbot/plugins/games/hangman.rb +++ b/data/rbot/plugins/games/hangman.rb @@ -242,15 +242,15 @@ class HangmanPlugin < Plugin def help(plugin, topic="") case topic when "" - return "hangman game plugin - topics: play, stop" + return _("hangman game plugin - topics: play, stop") when "play" - return "hangman play on with word => use in private chat with the bot to start a game with custom word\n"+ - "hangman play random [with [max|min] length [<|>|== ]] => hangman with a random word from #{RandomWord::SITE}\n"+ - "hangman play with wordlist => hangman with random word from " + return [_("hangman play on with word => use in private chat with the bot to start a game with custom word\n"), + _("hangman play random [with [max|min] length [<|>|== ]] => hangman with a random word from %{site}\n"), + _("hangman play with wordlist => hangman with random word from ")].join when "stop" - return "hangman stop => quits the current game" + return _("hangman stop => quits the current game") when "define" - return "define => seeks a definition for the previous answer using google" + return _("define => seeks a definition for the previous answer using google") end end @@ -261,7 +261,7 @@ class HangmanPlugin < Plugin begin wordlist = Wordlist.get(params[:wordlist].join("/"), :spaces => true) rescue - raise "no such wordlist" + raise _("no such wordlist") end wordlist[rand(wordlist.size)] @@ -282,7 +282,7 @@ class HangmanPlugin < Plugin unless words.empty? words.first else - m.reply "suitable word not found in the set" + m.reply _("suitable word not found in the set") nil end else @@ -371,7 +371,7 @@ class HangmanPlugin < Plugin _("you've killed the poor guy :(") end - again = _("go #{Bold}again#{Bold}?") + again = _("go %{b}again%{b}?") % { :b => Bold } scores = [] game.scores.each do |user, score| -- cgit v1.2.3