<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer">7836</assigned-user-id>
  <attachments-count type="integer">1</attachments-count>
  <closed type="boolean">false</closed>
  <created-at type="datetime">2008-11-19T13:52:37-05:00</created-at>
  <creator-id type="integer">38164</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">7</number>
  <permalink>support-for-i18n</permalink>
  <priority type="integer">10</priority>
  <project-id type="integer">11072</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>new</state>
  <tag>i18n patch</tag>
  <title>Support for I18n</title>
  <updated-at type="datetime">2009-02-06T10:38:26-05:00</updated-at>
  <user-id type="integer">41860</user-id>
  <user-name>Roman Shterenzon</user-name>
  <creator-name>martoche</creator-name>
  <assigned-user-name>Jason L Perry</assigned-user-name>
  <url>http://ambethia.lighthouseapp.com/projects/11072/tickets/7</url>
  <original-body>The error &quot;Captcha response is incorrect, please try again.&quot; is hardcoded in English.
It would be great is the plugin looked for a translation using the internationalization system in Rails 2.2+.


Martin</original-body>
  <latest-body>The error &quot;Captcha response is incorrect, please try again.&quot; is hardcoded in English.
It would be great is the plugin looked for a translation using the internationalization system in Rails 2.2+.


Martin</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;The error &quot;Captcha response is incorrect, please try again.&quot; is
hardcoded in English. It would be great is the plugin looked for a
translation using the internationalization system in Rails
2.2+.&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer">7836</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>The error &quot;Captcha response is incorrect, please try again.&quot; is hardcoded in English.
It would be great is the plugin looked for a translation using the internationalization system in Rails 2.2+.


Martin</body>
      <body-html>&lt;div&gt;&lt;p&gt;The error &quot;Captcha response is incorrect, please try again.&quot; is
hardcoded in English. It would be great is the plugin looked for a
translation using the internationalization system in Rails
2.2+.&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-19T13:52:37-05:00</created-at>
      <creator-id type="integer">38164</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">7</number>
      <permalink>support-for-i18n</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11072</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>Support for I18n</title>
      <updated-at type="datetime">2008-11-19T13:52:37-05:00</updated-at>
      <user-id type="integer">38164</user-id>
      <user-name>martoche</user-name>
      <creator-name>martoche</creator-name>
      <assigned-user-name>Jason L Perry</assigned-user-name>
      <url>http://ambethia.lighthouseapp.com/projects/11072/tickets/7</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">7836</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Hmm, yes, great idea. I've got a ton of patches to sift through, I'm  
gonna try to set aside some time this week to take care of them. I'll  
definitely work on this one too.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hmm, yes, great idea. I've got a ton of patches to sift through,
I'm gonna try to set aside some time this week to take care of
them. I'll definitely work on this one too.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-20T03:24:34-05:00</created-at>
      <creator-id type="integer">38164</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">7</number>
      <permalink>support-for-i18n</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11072</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>Support for I18n</title>
      <updated-at type="datetime">2008-11-20T03:24:36-05:00</updated-at>
      <user-id type="integer">7836</user-id>
      <user-name>Jason L Perry</user-name>
      <creator-name>martoche</creator-name>
      <assigned-user-name>Jason L Perry</assigned-user-name>
      <url>http://ambethia.lighthouseapp.com/projects/11072/tickets/7</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">7836</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Please find attached a patch which adds I18n support.

By the way, the latest changes introduced to the recaptcha rendered the rdoc incorrect.
It's impossible to use verify_recaptcha(@model) now, you have rather use verify_recaptcha(:model =&gt; @model). I wasted some time in order to understand, why I'm not getting any errors in my model. The simple fix can be adding
@@@
@@ -51,6 +51,7 @@ module Ambethia
       # variable +RECAPTCHA_PUBLIC_KEY+.
       def verify_recaptcha(options = {})
         return true if SKIP_VERIFY_ENV.include? ENV['RAILS_ENV']
+        model = options if options.is_a? ActiveRecord::Base
         private_key = options[:private_key] ||= ENV['RECAPTCHA_PRIVATE_KEY']
         raise ReCaptchaError, &quot;No private key specified.&quot; unless private_key
         begin
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;Please find attached a patch which adds I18n support.&lt;/p&gt;
&lt;p&gt;By the way, the latest changes introduced to the recaptcha
rendered the rdoc incorrect. It's impossible to use
verify_recaptcha(@model) now, you have rather use
verify_recaptcha(:model =&amp;gt; @model). I wasted some time in order
to understand, why I'm not getting any errors in my model. The
simple fix can be adding&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
@@ -51,6 +51,7 @@ module Ambethia
       # variable +RECAPTCHA_PUBLIC_KEY+.
       def verify_recaptcha(options = {})
         return true if SKIP_VERIFY_ENV.include? ENV['RAILS_ENV']
+        model = options if options.is_a? ActiveRecord::Base
         private_key = options[:private_key] ||= ENV['RECAPTCHA_PRIVATE_KEY']
         raise ReCaptchaError, &amp;quot;No private key specified.&amp;quot; unless private_key
         begin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-18T13:27:17-05:00</created-at>
      <creator-id type="integer">38164</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: 
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">7</number>
      <permalink>support-for-i18n</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11072</project-id>
      <state>new</state>
      <tag>i18n patch</tag>
      <title>Support for I18n</title>
      <updated-at type="datetime">2009-01-18T13:27:19-05:00</updated-at>
      <user-id type="integer">41860</user-id>
      <user-name>Roman Shterenzon</user-name>
      <creator-name>martoche</creator-name>
      <assigned-user-name>Jason L Perry</assigned-user-name>
      <url>http://ambethia.lighthouseapp.com/projects/11072/tickets/7</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">7836</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Hmm.. no, sorry, the line &quot;if model = options[:model]&quot; should be changed as well.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hmm.. no, sorry, the line &quot;if model = options[:model]&quot; should be
changed as well.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-18T13:29:15-05:00</created-at>
      <creator-id type="integer">38164</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">7</number>
      <permalink>support-for-i18n</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11072</project-id>
      <state>new</state>
      <tag>i18n patch</tag>
      <title>Support for I18n</title>
      <updated-at type="datetime">2009-01-18T13:29:20-05:00</updated-at>
      <user-id type="integer">41860</user-id>
      <user-name>Roman Shterenzon</user-name>
      <creator-name>martoche</creator-name>
      <assigned-user-name>Jason L Perry</assigned-user-name>
      <url>http://ambethia.lighthouseapp.com/projects/11072/tickets/7</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">7836</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>I came up with the following, seems to work for both the old and the new way of specifying the model.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I came up with the following, seems to work for both the old and
the new way of specifying the model.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-18T13:37:35-05:00</created-at>
      <creator-id type="integer">38164</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">7</number>
      <permalink>support-for-i18n</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">11072</project-id>
      <state>new</state>
      <tag>i18n patch</tag>
      <title>Support for I18n</title>
      <updated-at type="datetime">2009-01-18T13:37:36-05:00</updated-at>
      <user-id type="integer">41860</user-id>
      <user-name>Roman Shterenzon</user-name>
      <creator-name>martoche</creator-name>
      <assigned-user-name>Jason L Perry</assigned-user-name>
      <url>http://ambethia.lighthouseapp.com/projects/11072/tickets/7</url>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>73763463ef5a02ca67fbaa06dad4a6957c07cc86</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2009-01-18T13:37:35-05:00</created-at>
      <filename>recaptcha_new.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">79508</id>
      <size type="integer">1398</size>
      <uploader-id type="integer">41860</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://ambethia.lighthouseapp.com/attachments/79508/recaptcha_new.diff</url>
    </attachment>
  </attachments>
</ticket>
