Currently I am developing an app. My user registration uses the recaptcha plugin. When the Captcha is wrong, the app gets the error:
How can I translate this message with I18n.t
?
Hm
I found a solution to translate this message n the Recaptcha documentation page.
The verify_recaptcha method provide the :message option but this does not worked for me.
respond_to do |format|
if verify_recaptcha(:model => @post, :message => 'Oh! It's error with reCAPTCHA!') && @post.save
# ...
else
# ...
end
end
I overwrite the flash message. (thx to slobodan)
respond_to do |format|
if verify_recaptcha
# ...
else
flash[:recaptcha_error] = I18n.t("defaults.recaptcha")
# ...
end
end