简体   繁体   English

Yiic消息翻译失败

[英]Yiic message translation failing

I'm trying to prep translation for a module. 我正在尝试为模块准备翻译。 my config.php is just a copy from the framework, modified 'languages' for just 'fr'. 我的config.php只是框架的一个副本,只是将“ fr”修改为“ languages”。 Here's my config.php file 这是我的config.php文件

return array(
  'language'=>'en',
  'sourcePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
  'messagePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'messages',
  'languages'=>array('fr'),
  'fileTypes'=>array('php'),
  'overwrite'=>true,
  'exclude'=>array(
    '.svn',
    '.gitignore',
    '/i18n/data',
    '/messages',
  ),
);

The command runs properly, and I get this kind of output: 该命令正常运行,并且我得到以下输出:

Extracting messages from <MyProject>/protected/modules/admin/views/significantEvent/view.php...
...
Extracting messages from <MyProject>/protected/modules/admin/views/projectProgress/update.php...

But that's it. 就是这样。 Nothing is changed anywhere, there's no new files, nothing was edited. 在任何地方都没有任何更改,没有新文件,没有编辑任何内容。 It seems like the command didn't do anything but read all the files and tell me where to translate. 该命令似乎什么也没做,只是读取了所有文件并告诉我在哪里翻译。 What am I doing wrong? 我究竟做错了什么?

You will probably have to edit your messages/config.php file so it includes the contents of the module. 您可能需要编辑messages / config.php文件,使其包含模块的内容。

set the sourcepath part of the array to 将数组的sourcepath部分设置为

'sourcePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..',

And set the 'exclude' part to 并将“排除”部分设置为

'exclude' => array(
        '.svn',
        '.gitignore',
        '/assets',
        '/css',
        '/images',
        '/js',
        '/yii',
        '.htaccess',
        'index.php',
        'index-test.php'
    )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM