]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
poll: cope with gettext frozen string
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 30 Nov 2010 17:46:06 +0000 (18:46 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 30 Nov 2010 17:46:06 +0000 (18:46 +0100)
Some gettext versions freeze the string they return, so dup them before
modifying them.

data/rbot/plugins/poll.rb

index 4109321dc34400fc20503a71028f5fa8f294add7..086a929734d7052431471239652e1153a0b7ecd2 100644 (file)
@@ -87,7 +87,7 @@ class ::Poll
   end
 
   def options
-    options = _("options are: ")
+    options = _("options are: ").dup
     @answers.each { |letter, info|
       options << "#{Bold}#{letter}#{NormalText}) #{info[:value]} "
     }
@@ -201,7 +201,7 @@ class PollPlugin < Plugin
     command = _("poll vote %{id} <SINGLE-LETTER>") % {
       :id => poll.id
     }
-    instructions = _("you have %{duration}, vote with ")
+    instructions = _("you have %{duration}, vote with ").dup
     instructions << _("%{priv} or %{public}")
     m.reply instructions % {
       :duration => "#{Bold}#{target_duration}#{Bold}",