Running yiic message -> error

Hello

I’m trying to run Yiic message to extract messages to translate and am getting the following error:


Parse error: parse error in C:\Users\Public\Documents\httpdocs\yii\cli\commands\MessageCommand.php(138) : eval()'d code on line 1

**.array(2) {

  ["profile',$field->error_message);

                                array_push($rules,$field_rule);

                        }

It appears as though the regex is not correctly recognising the situation “Yii::t(‘category’,$variable)”

I’ve always struggled with regex so can anyone help!

Thanks

Chris

Yii::t() isn’t designed for this use case. Create another translation function to handle this case, I put mine in controller and did $this->t(). Based on Qiang’s feedback when I put this in the bug system.

Thanks Say_Ten. I tried that and it got a bit further but it was still falling over with invalid filename. So I changed MessageCommand.php and added the following code at the top of protected function generateMessageFile


		

   $fn= preg_split("/[\s,\']+/", $fileName);

   $fileName=$fn[0];

   echo "Saving messages to $fileName...";



Also, although there is a loop for languages, there is no code to explode this from the input parameters. So I added this to the main run function just before the language loop




	$languages=explode(",", $languages["0"]);



Note: that languages was an array but contained the list of languages unexploded!