开发者

Symfony ReCaptcha multi translations

I use symfony 1.4.11 with doctrin开发者_StackOverflow中文版e. And I use ReCaptcha from sfFormExtraPlugin. I have 3 language in my site. Russian, Ukrainian and English. In form I get current culture: For example:

$this->widgetSchema['captcha'] = new sfWidgetFormReCaptcha(array(
                 'public_key' => sfConfig::get('app_recaptcha_public_key'),
                 'theme'=>sfConfig::get('app_recaptcha_theme'),
                 'culture'=>$this->options['culture'],
            ));

With English and Russian it is all ok. But ReCaptcha do not support Ukrainian. So when I make custom_translations I have one language in all cultures. Is it possible to solve it?

Thank you!


How about using some sort of switch / select syntax and use whichever translation that matches the culture?

Skeleton code:

switch (culture)
  case "ukrainian":
    recaptcha.customTranslations = ukranianTranslations
  case "russian":
    recaptcha.customTranslations = russianTranslations

Something like that. You don't have to put all the translations on the same page since I assume that you will only show one language at a time?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜