yii-jst Translate message with current language by javascript.

  1. Description
  2. Requirements
  3. Usage
  4. Add import path and override CPhpMessageSource in main.php
  5. Links

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

0 0
2 followers
0 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Developed by: akaNightmare akaNightmare
Created on: Apr 14, 2013
Last updated: 12 years ago

Related Extensions