From 594341fb163c79f976533d4ece673c9010130869 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Sat, 25 May 2013 22:33:50 +0400 Subject: [PATCH] language as code, not bundle --- framework/yii/jui/DatePicker.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/yii/jui/DatePicker.php b/framework/yii/jui/DatePicker.php index 17c36f8..1138b73 100644 --- a/framework/yii/jui/DatePicker.php +++ b/framework/yii/jui/DatePicker.php @@ -17,7 +17,7 @@ use yii\helpers\Html; * * ```php * echo DatePicker::widget(array( - * 'language' => 'yii/jui/datepicker/i18n/ru', + * 'language' => 'ru', * 'model' => $model, * 'attribute' => 'country', * 'clientOptions' => array( @@ -30,7 +30,7 @@ use yii\helpers\Html; * * ```php * echo DatePicker::widget(array( - * 'language' => 'yii/jui/datepicker/i18n/ru', + * 'language' => 'ru', * 'name' => 'country', * 'clientOptions' => array( * 'dateFormat' => 'yy-mm-dd', @@ -45,7 +45,8 @@ use yii\helpers\Html; class DatePicker extends InputWidget { /** - * @var string the jQuery UI datepicker widget language bundle. + * @var string the locale ID (eg 'fr', 'de') for the language to be used by the date picker. + * If this property set to false, I18N will not be involved. That is, the date picker will show in English. */ public $language = false; /** @@ -62,7 +63,7 @@ class DatePicker extends InputWidget echo $this->renderWidget() . "\n"; $this->registerWidget('datepicker'); if ($this->language !== false) { - $this->getView()->registerAssetBundle($this->language); + $this->getView()->registerAssetBundle("yii/jui/datepicker/i18n/$this->language"); } }