فهرست منبع

Merge remote branch 'DerekRoth/patch-1'

* DerekRoth/patch-1:
  A constructor returning null is counter-intuitive. BTW, isn't this a intl bug ?
Fabien Potencier 14 سال پیش
والد
کامیت
78b91a017e
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      src/Symfony/Component/Locale/Locale.php

+ 3 - 3
src/Symfony/Component/Locale/Locale.php

@@ -41,7 +41,7 @@ class Locale extends \Locale
     static public function getDisplayCountries($locale)
     {
         if (!isset(self::$countries[$locale])) {
-            $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/region');
+            $bundle = \ResourceBundle::create($locale, __DIR__.'/Resources/data/region');
 
             if (null === $bundle) {
                 throw new \RuntimeException('The country resource bundle could not be loaded');
@@ -88,7 +88,7 @@ class Locale extends \Locale
     static public function getDisplayLanguages($locale)
     {
         if (!isset(self::$languages[$locale])) {
-            $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/lang');
+            $bundle = \ResourceBundle::create($locale, __DIR__.'/Resources/data/lang');
 
             if (null === $bundle) {
                 throw new \RuntimeException('The language resource bundle could not be loaded');
@@ -133,7 +133,7 @@ class Locale extends \Locale
     static public function getDisplayLocales($locale)
     {
         if (!isset(self::$locales[$locale])) {
-            $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/names');
+            $bundle = \ResourceBundle::create($locale, __DIR__.'/Resources/data/names');
 
             if (null === $bundle) {
                 throw new \RuntimeException('The locale resource bundle could not be loaded');