I made a little adjustment to the module to also be able to use this in AJAX requests. There are probably better ways to do this but it got the job done for me.
in WTranslate.php (under Widgets) replace the function registerScripts with :
public function registerScripts()
{
$translations = function_exists('json_encode') ? json_encode($this->translations) : CJSON::encode($this->translations);
if(!Yii::app()->request->isAjaxRequest )
{
$js = <<<EOD
var wtranslate = (function($){
var open = false;
var l = null;
var t = {$translations};
var pub = {
msg: function(o){
if(jbar) {jbar.open(o);}
},
add: function(col, obj){
var li = $('<li/>').addClass('item');
if (obj.new == 'yes')
var div = $('<div/>').text(obj.text);
else
var div = $('<div/>').text(obj.text).addClass('edited');
var a = $('<a/>',{class: 'wtranslate fancybox.ajax', id:'wt-'+obj.ref, href: obj.url}).text('edit');
var span = $('<span/>').append(a);
div.append(span);
li.append(div);
$('ul',col).append(li);
col.show();
},
update: function (f)
{
var data = f.serialize();
$.ajax({
url: f.attr('action'),
data: data,
dataType: 'json',
type: 'post',
success: function(d){
if(typeof d == 'object')
{
var a = $('#wt-'+d.id);
if(a.length){
a.closest('div').addClass('edited');
}
jbar.open(d);
}
}
});
$.fancybox.close();
},
buildLinks: function() {
var cnt = 1;
for(i=0; i<t.length; i++)
{
this.add($('.col'+cnt, l), t[i]);
if(++cnt > 3) {cnt = 1;}
}
},
buildSlider: function(){
l = $('<div/>').attr('id','wtranslator-footerSlideContainer');
var button = $('<div/>').attr('id','wtranslator-footerSlideButton');
var content = $('<div/>').attr('id','wtranslator-footerSlideContent');
var text = $('<div/>').attr('id','wtranslator-footerSlideText');
text.html("\
<h3>{$this->title}</h3>\
<div id='one-true'>\
<div class='col col1'><ul></ul></div>\
<div class='col col2'><ul></ul></div>\
<div class='col col3'><ul></ul></div>\
</div>");
content.append(text);
l.append(button,content);
$('body').append(l);
},
init: function(){
//if( !t.length ) return; /* no missing translations? what do you wish to do?*/
this.buildSlider();
this.buildLinks();
$(".wtranslate").fancybox({
width : 800,
height : 600,
minWidth : 800,
fitToView : false,
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
topRatio : 0,
afterShow : function(){
$('.wtranslate-wysiwyg').wysiwyg({initialContent:''});
$(".fancybox-wrap").css({"top":0, "margin":"100px 0 0"});
}
});
jQuery('.fancybox-wrap').css('margin-top', '120px');
$('#wtranslator-footerSlideButton').on('click',function(){
var content = $('#wtranslator-footerSlideContent');
var w = $('#wtranslator-footerSlideText').height() + 50;
if(content.is(':animated'))
return false;
if(content.hasClass('footerSlideVisible')){
content.animate({ height: '0px' }).removeClass('footerSlideVisible').addClass('footerSlideHidden');
$(this).css('backgroundPosition', 'top left');
}
else {
content.animate({ height: w+'px' }).removeClass('footerSlideHidden').addClass('footerSlideVisible');
$(this).css('backgroundPosition', 'bottom left');
}
return false;
});
$(document).on('click', '.translate-buttons > a', function() {
var action = $(this).attr('rel');
if(action=='submit')
{
var frm = $('.translate-form > form');
wtranslate.update(frm);
}
else if(action=='close')
{
$.fancybox.close();
}
return false;
});
}
};
return pub;
})(jQuery);
EOD;
$assets = Yii::app()->getAssetManager()->publish(dirname(__FILE__) . '/assets');
$cs = Yii::app()->clientScript;
/* widget js files */
$cs->registerCoreScript('jquery');
$cs->registerScript(__CLASS__ . 'EndJS', $js, CClientScript::POS_END);
/* fancybox files */
$cs->registerCssFile($assets . '/fancybox/source/jquery.fancybox.css');
$cs->registerScriptFile($assets . '/fancybox/source/jquery.fancybox.pack.js', CClientScript::POS_END);
/* jwysiwyg files */
$cs->registerCssFile($assets . '/jwysiwyg/jquery.wysiwyg.css');
$cs->registerScriptFile($assets . '/jwysiwyg/jquery.wysiwyg.js', CClientScript::POS_END);
$cs->registerScriptFile($assets . '/jwysiwyg/controls/wysiwyg.link.js', CClientScript::POS_END);
$cs->registerScriptFile($assets . '/jwysiwyg/controls/wysiwyg.table.js', CClientScript::POS_END);
/* modified jbar files */
$cs->registerCssFile($assets . '/jbar/css/jbar.style.css');
$cs->registerScriptFile($assets . '/jbar/jquery.bar.js', CClientScript::POS_END);
/* widget style files */
$cs->registerCssFile($assets . '/wtranslator.style.css');
/* init the module on document ready */
$cs->registerScript('WTranslateReadyJS', 'wtranslate.init();', CClientScript::POS_READY);
}
else
{
$js = <<<EOD
var t = {$translations};
var l = null;
function add(col, obj){
var li = $('<li/>').addClass('item');
if (obj.new == 'yes')
var div = $('<div/>').text(obj.text);
else
var div = $('<div/>').text(obj.text).addClass('edited');
var a = $('<a/>',{class: 'wtranslate fancybox.ajax', id:'wt-'+obj.ref, href: obj.url}).text('edit');
var span = $('<span/>').append(a);
div.append(span);
li.append(div);
$('ul',col).append(li);
col.show();
}
function buildLinks() {
var cnt = 1;
for(i=0; i<t.length; i++)
{
this.add($('.col'+cnt, l), t[i]);
if(++cnt > 3) {cnt = 1;}
}
}
buildLinks();
EOD;
}
$cs = Yii::app()->clientScript;
$cs->registerScript(__CLASS__ . 'EndJS', $js, CClientScript::POS_END);
}
And put this in every partial view rendered by Ajax:
echo Yii::app()->translate->renderMissingTranslationsEditor();
Hope this helps!