-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Symfony/Locale getDisplayCountries for de_CH got only a few countries #5314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
ping @eriksencosta |
Guys, I'll check it later today. I need to look at the ICU data source files. |
The ICU data repository have a lot of countries for the http://source.icu-project.org/repos/icu/icu/tags/release-49-1-2/source/data/region/de.txt |
Wait... @dominikzogg can you plase provide a code snippet with your problem? The Locale class merges the data for a locale with its fallback locale (i.e., merges the data for |
Well i've done a new test: get symfony: php composer.phar create-project symfony/framework-standard-edition symfony created a test bundle: php app/console generate:bundle creted an entity: <?php
namespace Ibrows\TestBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Ibrows\TestBundle\Entity\Test
*
* @ORM\Table()
* @ORM\Entity
*/
class Test
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string $country
*
* @ORM\Column(name="country", type="string", length=2)
*/
private $country;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set country
*
* @param string $country
* @return Test
*/
public function setCountry($country)
{
$this->country = $country;
return $this;
}
/**
* Get country
*
* @return string
*/
public function getCountry()
{
return $this->country;
}
} created a form type: <?php
namespace Ibrows\TestBundle\Form;
use Ibrows\TestBundle\Entity\Test;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class TestType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('country', 'country')
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Ibrows\\TestBundle\\Entity\\Test',
));
}
public function getName()
{
return 'test';
}
} controller: <?php
namespace Ibrows\TestBundle\Controller;
use Ibrows\TestBundle\Entity\Test;
use Ibrows\TestBundle\Form\TestType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class TestController extends Controller
{
/**
* @Route("/")
* @Template()
*/
public function indexAction()
{
// create new test entity
$objTestEntity = new Test();
// create new test form
$objTestForm = $this->createForm(new TestType(), $objTestEntity);
// return array
return array
(
'testform' => $objTestForm->createView()
);
}
} template: {{ form_widget(testform) }} with locale en or de i get the full list, with locale de_CH i get only this (php54, intl extension installed): <div id="test">
<div>
<label for="test_country" class="required">Country</label>
<select id="test_country" name="test[country]" required="required">
<option value="QO">Äusseres Ozeanien</option>
<option value="BD">Bangladesh</option>
<option value="BW">Botswana</option>
<option value="BN">Brunei</option>
<option value="DJ">Djibouti</option>
<option value="GB">Grossbritannien</option>
<option value="CV">Kapverden</option>
<option value="MH">Marshall-Inseln</option>
<option value="RW">Rwanda</option>
<option value="SB">Salomon-Inseln</option>
<option value="ST">Sao Tomé und Principe</option>
<option value="BY">Weissrussland</option>
<option value="ZW">Zimbabwe</option>
</select>
</div>
<input type="hidden" id="test__token" name="test[_token]" value="33748ea4007e59067dad42121d20c2e6d27214d6"/>
</div> |
Thanks @dominikzogg. I'll try to reproduce it using the code you provided. |
The PR #5641 fixes this bug. |
@eriksencosta thx, will test it and close this issue. |
This PR was squashed before being merged into the 2.5-dev branch (closes #8423). Discussion ---------- Update LocaleTest.php de_CH locales does not fallback to de see symfony/symfony#5314 Commits ------- 572126b Update LocaleTest.php
Hello
It seems, there is a bug in file symfony/src/Symfony/Component/Locale/Resources/data/region/de_CH.res, there are only a few countries (aprox 10-12).
Regards dominik
The text was updated successfully, but these errors were encountered: