licass
(L R M D)
August 27, 2013, 2:00pm
1
Strugling with yiic message.
ok follow http://code.google.com/p/yii/issues/detail?id=2306
and remove the ‘s’ from regexp but only the directories are generated not the files with the Yii::t contents.
Shouldn’t the files be generated also?
ex:
i use Yii::t(“content”,‘Pedir info item’)
‘content’ is the name of the file, but only directories are generated.
Thanks for the help
Don’t use variables in messages to be translated, use placeholders.
licass
(L R M D)
August 27, 2013, 2:08pm
3
i’m not using variables, just plain text
can you give me example
Maybe you can give an example how you call ./yiic message and how does your config file looks like?
licass
(L R M D)
August 27, 2013, 2:28pm
5
[/code]
[quote="nineinchnick, post:4, topic:63933"]
Maybe you can give an example how you call ./yiic message and how does your config file looks like?
[/quote]
[code]return array(
'sourcePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'messagePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'messages',
'languages'=>array('en','fr','zh_cn','ja'), // according to your translation needs
'fileTypes'=>array('php'),
'overwrite'=>TRUE,
'removeOld'=>FALSE,
'sort'=>true,
'exclude'=>array(
'.svn',
'.gitignore',
'yiilite.php',
'yiit.php',
'/i18n/data',
'/messages',
'/vendors',
'/web/js',
'UserModule.php', // if you are using yii-user ...
),
);
yiic message messages.php
Where is the config file located and in what directory do you run the command?
licass
(L R M D)
August 28, 2013, 11:33am
7
the config file is in protected/config and an run the command there.
PHP Error[8]: Undefined variable: data
in file /home/led/Documents/scout/framework/cli/commands/MessageCommand.php(144) : eval()'d code at line 1
#0 /home/led/Documents/scout/framework/cli/commands/MessageCommand.php(144): eval()
#1 /home/led/Documents/scout/framework/cli/commands/MessageCommand.php(110): MessageCommand->extractMessages()
#2 /home/led/Documents/scout/framework/console/CConsoleCommandRunner.php(67): MessageCommand->run()
#3 /home/led/Documents/scout/framework/console/CConsoleApplication.php(91): CConsoleCommandRunner->run()
#4 /home/led/Documents/scout/framework/base/CApplication.php(169): CConsoleApplication->processRequest()
#5 /home/led/Documents/scout/framework/yiic.php(33): CConsoleApplication->run()
#6 /home/led/Documents/scout/protected/yiic.php(7): require_once()
led@ledled:~/Documents/scout/protected$
removing the ‘s’ as in http://code.google.com/p/yii/issues/detail?id=2306
that is what i get
licass
(L R M D)
August 28, 2013, 12:07pm
8
thanks i just use an hibrid system, fromdb and message files.
ex:
Yii::t("content","$data->description",array(),"db_i18n")
solved thanks.