0
votes

I'm having problems with SonataAdminBundle when editing or creating:

The Symfony\Component\Locale\Stub\StubNumberFormatter::getSymbol() is not implemented. Please install the 'intl' extension for full localization capabilities.

or

Fatal error: Class 'ResourceBundle' not found in F:\xampp\htdocs\Symfony2\vendor\symfony\symfony\src\Symfony\Component\Locale\Locale.php on line 157

I cant install php extensions in my basic hosting

I found this, but it just works when NumberFormatter is called, obviously I have to create each class needed to call the intl extension but I asks here to expert to see any others ways solution/workaround/suggestion to get work without the intl extension

1

1 Answers

0
votes

The problem is that the function getSymbole not defined in Symfony\Component\Locale\Stub\StubNumberFormatter. This method throws an exception, this is its body :

  public function getSymbol($attr)
{
    throw new MethodNotImplementedException(__METHOD__);
}

It should be implemented to remove this exception, you can modefied like this :

        public function getSymbol($attr)
    {
    switch($attr) {
      case self::CURRENCY_SYMBOL:
        return '$';
      case self::DECIMAL_SEPARATOR_SYMBOL:
        return '.';
      case self::DIGIT_SYMBOL:
        return '#';
      case self::EXPONENTIAL_SYMBOL:
        return 'E';
      case self::GROUPING_SEPARATOR_SYMBOL:
        return ',';
        ;
  }

This modification works fine with me, I had the same problem. But if you upgrade your symfony version via composer you may lose your modification.