You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Kartik
In my test-fork of your extension I have added automatic language support. If language isn't defined in pluginOptions the init method calls yii::$app->language. To make it more user friendly I have added a "normal" option $language. But this is only necessary if developer wants to set language manually.
Language is set often like en-US. That's why I have added a codeline later in registerAssets to take first two letters ("en").
New entry in common part:
/** added by Enrica: * @var string the locale ID (eg 'fr', 'de') for the language to be used by the date picker. * If this property is empty, then the current application language will be used. */public$language;
New entry in method init:
if (!isset($this->pluginOptions['language'])){
$this->pluginOptions['language'] = $this->language ? $this->language : Yii::$app->language;
}
New entry in method registerAssets:
if (!empty($this->pluginOptions['language'])) {
// entered by Enrica: next line only$this->pluginOptions['language'] = substr($this->pluginOptions['language'], 0, 2);
DatePickerAsset::register($view)->js[] = 'js/locales/bootstrap-datepicker.' . $this->pluginOptions['language'] . '.js';
Do you want to add automatic language support? In my application I want to avoid hard coded settings. In my application user's language is stored in user table. After login yii::$app->language will be set by user's language.
The text was updated successfully, but these errors were encountered:
Hello Kartik
In my test-fork of your extension I have added automatic language support. If language isn't defined in
pluginOptions
the init method callsyii::$app->language
. To make it more user friendly I have added a "normal" option$language
. But this is only necessary if developer wants to set language manually.Language is set often like
en-US
. That's why I have added a codeline later inregisterAssets
to take first two letters ("en").New entry in common part:
New entry in method
init
:New entry in method
registerAssets
:Do you want to add automatic language support? In my application I want to avoid hard coded settings. In my application user's language is stored in user table. After login yii::$app->language will be set by user's language.
The text was updated successfully, but these errors were encountered: