如何在 Zend 中设置 ReCaptcha "en"语言?



我想强制 ReCaptcha 表单在 Zend 中仅使用 EN 语言,但是这些代码对我不起作用:

    $recaptcha = new Zend_Service_ReCaptcha($publickey, $privatekey);
    $captcha = new Zend_Form_Element_Captcha('captcha',
        array(
            'captcha'       => 'ReCaptcha',
            'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha, 'lang'=>'en'),
            'ignore' => true
            )
    );
    $this->addElement($captcha);

有什么想法吗?

我认为这应该有效(暂时无法测试,抱歉(

  $captcha = new Zend_Form_Element_Captcha('challenge', array(
            'captcha' => 'ReCaptcha',
                'captchaOptions' => array(
                'captcha' => 'ReCaptcha',
                'privKey' => ' ',
                'pubKey' => ' '
            )
    ));
    $captcha->getCaptcha()->getService()
            ->setOption('theme', 'white')
            ->setOption('lang', 'en'); // should do it

最新更新