nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nuxeo-localizer] Localizer and ZPT


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] Localizer and ZPT
Date: Wed, 10 Jul 2002 09:36:36 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 Debian/1.0.0-1

Hi,


EXPLANATION

This is the effect of the patch number 3 of Localizer.

Why? With a local folder object you can store images as img_en,
img_es, etc.. and then reference them with "folder.img". The
problem is that with the default behaviour of Image.__call__
you get the url ".../folder/img", then the image is cached by
the browser and it doesn't changes when the language changes.

The patch transforms this to the real physical path, which is
different for every image, "folder/img_en" or "folder/img_es",
this way it's possible to localize an image, doesn't matters
which language negotiation policy was choosed.


PROPOSAL

This patch comes from the old days when Localizer used SiteAccess.
Maybe it's posible to do something more elegant now. What about if
the patch preserved the normal url but appended the language extension?
In your example (if you used local folders) this could look like
"http://localhost:8080/Test/myimage_en"; instead of "/Test/myimage_en".

This way the url looks much more like the normal one, without throwing
off the use of Virtual Host Monster or SiteRoot stuff. But it would be
still different for every language and then the caching problem would be
avoided.

What do you think?


QUICK SOLUTION

In the meantime you can restore the normal behaviour commenting the line
that reads "Image.Image.tag = tag" in the "Localizer/__init__.py" file.


Cheers,



Calvin Hendryx-Parker wrote:

Hi,

I just found an interesting bug and wondered if anyone else has run across this. When I have Localizer installed and I use ZPT to make pages the URLs are changed. Here is an example of what I mean:

Before Localizer I would do this:

<img src="" tal:replace="structure here/myimage" />

and it would render to this:

<img src="http://lcoalhost:8080/Test/myimage"; height="1" width="1" alt="myimage" />

After Localizer I get this now and it is throwing off the use of Virtual Host Monster or SiteRoot since the Base won't change correctly on the URL:

<img src="/Test/myimage" height="1" width="1" alt="myimage" />

Is there anyway to get it to render the way the original ZPTs to it?

Thanks,
Calvin



--
J. David Ibáñez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software






reply via email to

[Prev in Thread] Current Thread [Next in Thread]