Hello. How would one provide alternate images based on i18n. For example: if english show image 1 if portuguese show image 2 I have been looking for ZPT examples, but everything I have found so far relates to translating text strings. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
hpinson@indepthl.com wrote:
Hello. How would one provide alternate images based on i18n. For example:
http://www.zope.org/Members/CodeSyntax/DTML_Localizer - Tip # 10 and below
Hi Sergey. Thanks. I should have been clearer. I need to do this in a Zope Page Template, specifically, in the Plone 2 header. The DTML is pretty straight forward but the xml python is eluding me. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
I should have been clearer. I need to do this in a Zope Page Template, specifically, in the Plone 2 header. The DTML is pretty straight forward but the xml python is eluding me.
Plone 2 uses css for caption image. So either you should to switch css'es based on user language or rewrite the appripriate macro to generate one or another <img> tag. Also, you can write a simple python script which returns the image you need. I've done this once with Localizer, hope you can modify it to work with Placeless Translation Service 1. Place logo_en, logo_ru or whatever your langusge is to portal_skins/custom 2. Create the following PythonScript named logo.jpg: ============= lang=context.portal_languages.getPreferredLanguage() if lang=='ru': return context.logo_ru else: return context.logo_en ============== 3. Modify to suit your needs.
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ZPTInternat... Look at the i18n:attributes example. Florian On Wed, 14 Apr 2004 17:11:16 -0600, <hpinson@indepthl.com> wrote:
Hi Sergey. Thanks.
I should have been clearer. I need to do this in a Zope Page Template, specifically, in the Plone 2 header. The DTML is pretty straight forward but the xml python is eluding me.
Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Florian Schulze -
hpinson@indepthl.com -
Sergey Volobuev