Ei18n Module

Ei18 是一个翻译模块,它允许用户轻松地管理应用程序页面上缺少的翻译。它的灵感来自于 yii。由 Gustavo Salome Silva 翻译。「Ei18 is a translation module to allow Yii'ers to easily manage missing translations on application pages. It is heavily inspired by yii.translate developed by Gustavo Salomé Silva.」

Github星跟踪图

=========================
Ei18n Module 0.1 Manual

Ei18n is a translation module to allow Yii'ers to easily manage missing translations on their application pages.
It is heavily inspired by yii.translate <https://github.com/gusnips/yii.translate>_
developed by Gustavo Salomé Silva gusnips <http://www.yiiframework.com/user/6112/>_.

The module also allows the edition of translations specified by categories. Its utility
widget WTranslate handles that very smoothly.

The frontend is all AJAX based. I thought that would be better to leave to developers
the creation of a backend in order to edit translations on a regular basis.

Plus, the Ei18n component has a couple of helper functions to the language settings
automation. Check the Set CAction class to be included on the controller that will
handle language settings.

========
Requires

* jQuery v1.7 or higher (tested with jQuery v1.7).
* `fancybox 2.0.5 <http://fancyapps.com/fancybox/>`_
* `jwysiwyg 0.97.2 <https://github.com/akzhan/jwysiwyg>`_
* jbar Jquery plugin -**Modified version**
* Yii 1.9

===========
Tested with

* Chrome 17.0.963.56 on Macosx Lion 
* Safari Version 5.1.3 (7534.53.10) on Macosx Lion
* Firefox 8.0.1 Macosx Lion
* Firefox 9.0.1 Macosx Lion

===========
Quick Start

On your main.php config file do the following::

/* import the module */
    'import'=>array(
    /* ... */
        'application.modules.translate.TranslateModule'
    /* ... */
/* setup your default language */
'language'=> 'en',
/* setup message translation method */
    'components'=>array(
        'messages' => array(
            'class' => 'CDbMessageSource',
            'onMissingTranslation' => array('Ei18n', 'missingTranslation'),
            'sourceMessageTable' => 'tbl_source_message',
            'translatedMessageTable' => 'tbl_message'
        ),
/* setup global translate application component */
        'translate' => array(
            'class' => 'translate.components.Ei18n',
            'createTranslationTables' => true,
            'connectionID' => 'db',
            'languages' => array(
                'en' => 'English',
                'es' => 'Español',
                'it' => 'Italiano'
                )
            ),
    ),
/* setup the module */
    'modules' => array(
        'translate'
    ),
/* preload the global translate application component */
    'preload'=> array(
        'translate'
    )
    /* ... */

Displaying the editor

Once the module and the translation component have been set. You can just use any of
the following helper functions::

Yii::app()->translate->renderMissingTranslationsEditor();
/* or */
/* Yii::app()->translate->renderTranslationsEditor(array('index','menu')); */

The first method, and due to the view rendering nature of Yii, I highly recommend the display of those functions
at the bottom of your main or base layout, as it will collect all missing ones throughout
the rendering process.

2amigOS!
web development has never been so fun
www.2amigos.us

主要指标

概览
名称与所有者2amigos/ei18n
主编程语言JavaScript
编程语言PHP (语言数: 5)
平台Linux, Mac, Windows
许可证
所有者活动
创建于2012-03-16 23:17:12
推送于2013-03-28 12:44:40
最后一次提交2013-03-28 05:44:39
发布数0
用户参与
星数24
关注者数7
派生数13
提交数20
已启用问题?
问题数5
打开的问题数0
拉请求数3
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?