Skip to content

Commit

Permalink
Fix #4: Default language to en when no locale found
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Aug 2, 2014
1 parent 8f0f661 commit c1947ca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions daterange/DateRangePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,10 @@ class DateRangePicker extends \kartik\widgets\InputWidget
public function init()
{
parent::init();
$this->initI18N();
if (!$this->checkLocale()) {
throw new InvalidConfigException("The locales have not been setup for your language '{$this->language}'. \n
You can submit the translations by reading the DateRangePicker documentation. \n
Alternatively, to continue without using any translations set the 'language' property to 'en' in your widget configuration.");
$this->language = 'en';
}
$this->initI18N();
if ($this->convertFormat && isset($this->pluginOptions['format'])) {
$this->pluginOptions['format'] = static::convertDateFormat($this->pluginOptions['format']);
}
Expand Down

1 comment on commit c1947ca

@Agrumas
Copy link
Contributor

@Agrumas Agrumas commented on c1947ca Aug 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.