yuracher писал(а):Решил попробовать это расширение и столкнулся с некоторыми проблемами
Hello,
Sorry for late response and for english answer, I hope it not problem for you.
1. As you can see in
TsUrlManager class, (
https://github.com/TaronSaribekyan/TsTr ... er.php#L15) extension only prepends
<_lang:\w{2}> for each rule.
F.e. if your rule is:
Код: Выделить всё
'<module(user)>/<controller:(admin)>/<action(action:\w+)>/<id:\d+>' => '<module>/<controller>/<action>',
it became:
Код: Выделить всё
'<_lang:\w{2}>/<module(user)>/<controller:(admin)>/<action(action:\w+)>/<id:\d+>' => '<module>/<controller>/<action>'
If you use
complicated URL rules, it's recomended to disable
prependLangRules (
prependLangRules => false) and add language rules manually (in position which you want).
Also be sure that you create URLs with right way:
Код: Выделить всё
Yii::app()->createUrl('MODULE_NAME / CONTROLLER_NAME / ACTION_NAME', array('id' => ID))
2. If you want to use any component in module, you must init it (or override already existing component). In this case you must override component
messages in
user module. It can be look something like this:
Код: Выделить всё
class UserModule extends CWebModule {
public function init() {
parent::init();
$this->setImport(array(
'user.models.*',
'user.components.*',
));
Yii::app()->setComponents(array(
'messages' => array(
NEW PARAMS FOR COMPONENT
),
), false);
}
}
Be sure that second parameter of method
setComponents set to
false, otherwise component new parameters
will be merged with old one (instead of overriding).
3. As I see,
Yiistrap load script files (such as jQuery and bootstrap) in end of body:
CClientScript::POS_END (
https://github.com/crisu83/yiistrap/blo ... i.php#L132).
So on
TsTranslationWidget and
TsLanguageWidget set parameter
scriptPosition => CClientScript::POS_END (as set
CClientScript::POS_HEAD). Be sure that attribute
scriptPosition set as "public" (formerly I set it "private":
https://github.com/TaronSaribekyan/TsTr ... 3d299b9a14).
For final result in generated HTML
bootstrap.js must be loaded before
bootstrap-editable.js and
tstranslation.js
Let me know If other questions. Thanks a lot !