Why do you translate it by hand?
---
$w = new sfWidgetFormI18nChoiceCountry(array('culture' => 'en', 'add_empty' =>
true));
$w->render('country', 'UK')
---
This does it for you!?
---
<select name="country" id="country">
<option value=""></option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
...
---
-
Frank
Am 10.04.2011 um 17:43 schrieb tobi:
> sfWidgetFormI18nChoiceCountry has a little bug but i don't know how to
> fix it without breaking bc.
>
> if you enable the addEmpty option of the widget the Country array will
> be merged ether with
> array(''=>'') or array(''=>'your text')
>
> the problem is that after array_merge the numeric keys of the coutries
> are messed up (150 => Europe become 12 =>Europe)
>
> this is now Problem as the same errors occures on save an load, but i
> translated the value with with the orignal countris. (so Europe become
> Eastern Africa).
>
> At the moment i solved this by also mergen an empty array where i
> translate the value.
>
> I don't think that there is a solution to fix this without breaking bc
> for existing apps but maybe it is possible tio avoid the same bug in
> sf2.0.
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en