Hi,
how can I translate message i.e: “cannot be blank” to another language? I`ve tried to create in directory named: “message” file pl_pl.php with translation but it doesn’t work
Hi,
how can I translate message i.e: “cannot be blank” to another language? I`ve tried to create in directory named: “message” file pl_pl.php with translation but it doesn’t work
thanx,
work but I have translation in framework/messages/pl. In configuration language is set to 'pl' but when I move pl direcotory to protected/messages this not work? Why?
When you call Yii::t($category,$message), make sure the first parameter is NOT 'yii' because it is reserved for the framework messages. Try using a different category and remember to rename your message file name.
qiang, what he is saying is that he needs to translate the messages that the framework makes appear when a rule (required in this case) of the model is not respected. the message "cannot be blank" are words not written in the application but in frameworks file, so the only solution is that you give to qiang the file yii.php translated to pl and he will add a directory pl under framework/messages. the same thing should be done by me for italian translation but i don't have time to do it now. (i absolutely have to do it).
I noted that you have done it for de and es.
I see. You can set the 'message' property to specify your own error message for the rule.
ah ok that's good. i would like to know, if i translate the yii.php file in italian can you put it in the message directory of the framework? in this way if in an application is set italian language the messages are automatically translated without use any additional property.
thanks
Of course. That's a great contribution to Yii and its community. Thank you very much!
I would anyway appreciate a solution where everybody can define his own messages even framework messages.
Thanks
Quote
just define your sources in the application's config file, and create your translation files (php or gettext). The quick guide tells you how