Yii 1.1: yii-jst

Translate message with current language by javascript.
2 followers

Description

Extension automatically collected all messages which used in current page and register to view.

window.messages = {"\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a":"monday","\u0432\u0442\u043e\u0440\u043d\u0438\u043a":"tuesday"} // etc.

after that u call Yii.t or _t js-method with your message.

Requirements

Yii 1.1 or above

Usage

Yii.t('any words');
_t('any words');

Add import path and override CPhpMessageSource in main.php

'import' => array(
    //  ...
    'ext.yii-js-t.*',
    //  ...
)
 
'components' => array(
    //  ...
    'messages' => array(
        'class' => 'JsTPhpMessageSource'
    ),
    //  ...
),
...

Override Controller from JsTController

Links

github: click

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet