Commit f6ef6c97 by Carsten Brandt

fixed crash of Formatter when intl is not installed

related to #5214
parent 478da530
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
namespace yii\i18n; namespace yii\i18n;
use DateTime; use DateTime;
use DateTimeInterface;
use IntlDateFormatter; use IntlDateFormatter;
use NumberFormatter; use NumberFormatter;
use Yii; use Yii;
...@@ -1010,7 +1009,9 @@ class Formatter extends Component ...@@ -1010,7 +1009,9 @@ class Formatter extends Component
// disable grouping for edge cases like 1023 to get 1023 B instead of 1,023 B // disable grouping for edge cases like 1023 to get 1023 B instead of 1,023 B
$oldThousandSeparator = $this->thousandSeparator; $oldThousandSeparator = $this->thousandSeparator;
$this->thousandSeparator = ''; $this->thousandSeparator = '';
$options[NumberFormatter::GROUPING_USED] = false; if ($this->_intlLoaded) {
$options[NumberFormatter::GROUPING_USED] = false;
}
// format the size value // format the size value
$params = [ $params = [
// this is the unformatted number used for the plural rule // this is the unformatted number used for the plural rule
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment