开发者

Zend Translate Zend Form!

Currently, isEmpty errors throw:

    Value is required and can't be empty

I'm loading my translator up like this:

[translation]

adapter = array
content.english["emailNotUnique"] = "Your user already exists"
content.english["Value is required and can't be empty"] = "You must specify your ID"
locale = en

The config above produces a valid array according to zend translate spec, so:

$this -> form -> setTranslator(new Zend_Tran开发者_JAVA百科slate($this -> getConfig() -> translation));

expected result is that isEmpty errors should now show up as

    You must specify your ID

However I'm getting no love. No errors and no translation. I'm on Zend 1.11.1 and PHP5.3.5.


I think that the problem is with english key in your ini file. Specifically it should not be there, because what you are actually passing to Zend_Translate as a content is:

    'content' => array(
        'english' => array(
            "emailNotUnique" => 'Your user already exists' ,
            "Value is required and can't be empty" => 'You must specify your ID' 
        )            
    );

And it should be:

    'content' => array(          
            "emailNotUnique" => 'Your user already exists' ,
            "Value is required and can't be empty" => 'You must specify your ID'             
    );

Hope this will help.


Try to change

content.english["isEmpty"] = "You must specify your ID"


you can user language file(MO) its simple translate in multiple language

when initialize bootstrap at a time initialize selected language

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜