0

我想强制 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);

有什么想法吗?

4

1 回答 1

0

我认为这应该可行(目前无法测试,抱歉)

  $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
于 2012-05-22T05:37:46.707 回答