CJuiDatePicker language + RenderPartial

Hi folks!

I’ve make as say in this post http://www.yiiframework.com/forum/index.php?/topic/19459-cjuidatepicker-not-support-render/ in order to get a form with renderpartial(), but the problem is if exists a CJuiDatePicker field, the language is always in Chinese.

However, if I see the form with render(), the locale parameter is ok.

What could be the problem?

I have similar problem (CJuiDatePicker field loaded into fancybox via AJAX)

Is there a solution to this one?

Hello,

Has anyone found a solution to this problem ?

I am having the exact same problem and can’t find a solution.

When rendering the form with render(), the locale works fine, but with renderPartial(’’,array(), false, true), the Date Picker is in chinese. Is there a way to make it work ?

Thanks !

You have to register your locale(s) in your partially rendered view.

Personally, I manually register the locale I need. I open the jquery-ui-i18n.min.js localization file, or better get it from jquery-ui website.

For French, for instance:


Yii::app()->clientScript->registerScript('frDatepicker.js', "

$(document).ready(function(){

	$.datepicker.regional['fr']={

		closeText:'Fermer',prevText:'Précédent',nextText:'Suivant',currentText:'Aujourd\'hui',

		monthNames:['Janvier','Février','Mars','Avril','Mai','Juin',

			'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],

		monthNamesShort:['Janv.','Févr.','Mars','Avril','Mai','Juin',

			'Juil.','Août','Sept.','Oct.','Nov.','Déc.'],

		dayNames:['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],

		dayNamesShort:['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'],

		dayNamesMin:['D','L','M','M','J','V','S'],

		weekHeader:'Sem.',dateFormat:'dd/mm/yy',firstDay:1,isRTL:false,

		showMonthAfterYear:false,yearSuffix:''};

	$.datepicker.setDefaults($.datepicker.regional['fr']);

});

", CClientScript::POS_READY);

Well thank you !! This is working great :)

But I’d like to know why I have to do that ? (And why setting to processOutput to true is not enough)

And why is Chinese displayed and not another language ?

(I’m just asking to understand this behavior)

Thank you :)

Found a solution.

Before renderPartial, add the following:




Yii::app()->clientScript->scriptMap['jquery.js'] = false;