Kiril,
Thanks for trying to shed light on Fabien's somewhat ambiguous
comment, but I don't think your suggestion will help for the i18n
extract task. In your example, it looks to me like the actual string
that needs to be extracted is still in the SomethingForm.class.php and
you are putting the callable wrapper around the output in the view
layer, although I think the code would have to look something like
this:
<?php echo __($form['field']->renderLabel('Label Field')) ?>
For it to return a translated string properly. This would work on the
display side I think, but it still means that there is no translatable
string for the extract task to find on the view layer.
According to the forms documentation regarding labels (http://
www.symfony-project.org/book/forms/1_1/en/01-Form-Creation#Labels ),
the label string is supposed to be in the SomethingForm.class.php -
I'm just not clear on how Fabien plans to get this working with the
i18n extract task. It does seem clear that i18n is supposed to be
fully integrated into the new form framework because when you have a
XLIFF translation string the translated message shows up correctly
without having to use the callable __() wrapper. It sounds to me like
Fabien objects to having the callable (__()) in the form class, but
I'm not sure why - I can only guess it may have to do with the
separation of the symfony framework and the forms framework.
However, until the i18n:extract task does pick up the form strings, we
will just keep using our little hack; The hack works for us, and we
really need these strings to be picked up for translation. I'm eager
to see Fabien's elegant solution to the problem. :)
Regards,
David
On Jan 21, 12:09 pm, Kiril Angov <[email protected]> wrote:
> I think Fabien was suggesting something along those lines:
>
> echo $form['field']->renderLabel(__('Label Field'));
>
> This way there are no string in the SomethingForm.class.php
>
> Kiril
>
> On Wed, Jan 21, 2009 at 1:03 AM, peterVG <[email protected]> wrote:
>
> > Thanks David,
>
> > This works for our project for now.
>
> > However, Fabien responded to your patch "We cannot apply this patch as
> > this is not a good practice to use () in the form classes."
>
> > Fabien, what approach do you suggest instead? Are you planning to
> > automatically include form widget labels, help text and validation
> > messages in the i18n:extract task without requiring the i18n
> > callables?
>
> > --peter
>
> > On Jan 20, 1:04 pm, David at Artefactual <[email protected]>
> > wrote:
> >> I've create a ticket and attached a patch regarding this issue
> >> @http://trac.symfony-project.org/ticket/5668
>
> >> David
>
> >> On Jan 16, 9:39 am, peterVG <[email protected]> wrote:
>
> >> > The 1.2 forms framework is currently not supported by the i18n:extract
> >> > task. I searched for a ticket to get an idea of where this is on the
> >> > dev roadmap but can't find one. Should I open a ticket?
>
> >> > --peter
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---