2017 © Pedro PelĂĄez
 

yii-module yii-ei18n

Ei18n is a translation module to allow Yii'ers to easily manage missing translations on their application pages.

image

2amigos/yii-ei18n

Ei18n is a translation module to allow Yii'ers to easily manage missing translations on their application pages.

  • Thursday, March 28, 2013
  • by tonydspaniard
  • Repository
  • 8 Watchers
  • 27 Stars
  • 66 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

=========================, (*1)

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/>_., (*2)

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

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., (*4)

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., (*5)

========, (*6)

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

===========, (*7)

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

===========, (*8)

Quick Start

On your main.php config file do the following::, (*9)

/* 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::, (*10)

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., (*11)

2amigOS!
web development has never been so fun www.2amigos.us, (*12)

The Versions

28/03 2013

dev-master

9999999-dev

Ei18n is a translation module to allow Yii'ers to easily manage missing translations on their application pages.

  Sources   Download

BSD-3-Clause

yii ei18n