I really need some help.
I have created two modules in my project: admin and account. In my admin module I have User model.
I have managed to translate my admin module using following structure:
modules
-admin
-models
-controllers
-views
-messages
- en
user.php
- ru
user.php
-AdminModule.php
and used following expression:
Yii::t("adminModule.user","Username")
to output my translated message.
However this doesn’t work if I’m trying to access User model from account module. Fields are not translated and application even troughs an exception:
include(adminModule.php): failed to open stream: No such file or directory
Seems like I’m not able to include my admin module. So I have tried to import it as follows within my account/AccountModule.php
public function init() {
$this->setImport(array(
'account.models.*',
'account.components.*',
'application.modules.admin.models.*',
'application.modules.admin.messages.*',
));
}
In my main config file I added following lines of code as it has been suggested. But no help,I still have the same exception.
'sourceLanguage' => 'en',
'language' => 'ru',
I’ve tried lots of stuff suggested in the following resources
Yii modules internationalization
www.rymland.org/post/27?title=Enforcing+translation+of+message+in+Yii
yii use message in module
Also read Yii documentation
yiiframework.ru/doc/guide/ru/topics.i18n
But yet nothing helped me.
If someone has some ideas, kindly ask you for your assistance, Thanks in advance