The reason I developed a new one is because Gustavo's approach wasn't suitable for my needs, I wanted the translation to be specific to the languages I was editing and not to edit them all at once. Also, the theme was not rendering right and I couldn't make it work properly as my design was not developed with the one Yii comes by default.
I wanted to make it as a component only but then I realized that to be a module was the right way to go as I could automate language edition without making the user tweak far too many things.
The following is a snapshot of the editor:
The configuration is a bit troublesome, but once you get it up and running editing your missing translations will be peanuts.
In order to make it run we need to:
On you main.php configuration 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' ) /* ... */
Once the module and the translation component have been set. You just use any of the following helper functions:
Yii::app()->translate->renderMissingTranslationsEditor(); /* or only certain categories*/ /* 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 processes.
Remember the translations are automatically collected when Yii goes through all those Yii::t('category','translation text'); statements throughout your code and fires the onMissingTranslation event.
Anybody willing to help improving E1i8n is highly welcome. Check the github repository on the resources section.