-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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


Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          [email protected]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlIFL9sACgkQ+gerLs4ltQ5wUACgqJBlwghjumZ6d5TlU9MLQjH0
hOgAoIJJ3B7fNEdGdMlGMSaswhiXf0Q1
=B9si
-----END PGP SIGNATURE-----

-- 
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.

Reply via email to