On Freitag, 9. August 2013 14:07:23 Tres Seaver wrote:
> On 08/09/2013 01:05 PM, Hans-Peter Jansen wrote:
> > Dear Pylonistas && Pyramistas,
> >
> > I'm in the process of evaluating web frameworks for some simple
> > projects, that highly depend on forms and i18n. For the time being, I
> > tend to use the Pyramid framework, which is a pleasure to work with
> > so far. Great work, guys.
> >
> > ATM, I'm stuck with some Chameleon rendering and i18n interaction
> > issue.
> >
> > I started from here:
> >
> > http://docs.pylonsproject.org/projects/pyramid_tutorials/en/latest/humans/
> > forms_schemas/step02/index.html
> and mangled it up to the point, where the form is translated
>
> > correctly apart from a small part of site_view.pt:
> >
> > Before: <p tal:condition="values">Valid form values: ${values.name}
> > and ${values.shoe_size}.</p>
> >
> > Became: <p tal:condition="values" i18n:translate="valid_values">Valid
> > form values: ${values.name} and ${values.shoe_size}.</p>
> >
> > Funnily, the expression is translated and displayed "correctly", but
> > is simply the values.* replacements missing, unlike the untranslated
> > version.
> >
> > I experimented with various tal:replace constructs for the values.*
> > expressions, which all resulted in ${values.name} for the translation
> > string, and consequently with the same rendering result, hence the
> > question: how do I formulate this <p> in a way, that translation
> > finally works.
>
> I haven't done i18n with the "shortcut" spellings in Chameleon. the form
> I would use looks like::
>
> <p tal:condition="values" i18n:translate="valid_values"
>
> >Valid form values:
> <span tal:content="values.name" i18n:name="name">NAME</span>
> and
> <span tal:content="values.shoe_size" i18n:name="shoe_size"
>
> >SHOE_SIZE</span>./p>
>
> The Plone docs for ZPT + i18n are fairly useful, even for Chameleon:
>
> http://plone.org/documentation/kb/i18n-for-developers
Thanks, Tres. That did the trick.
The thing, that wasn't obvious for me: the usual non-translated replacement
pattern is ${values.name} that becomes ${name} with translation in place.
Cheers,
Pete
>
> Tres.
> --
> ===================================================================
> Tres Seaver +1 540-429-0999 [email protected]
> Palladion Software "Excellence by Design" http://palladion.com
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.