I think you would have to parametrize your language in the URL: /images/:lang
short of checking if the file exists beforehand in your middleware, I have no idea how else you would implement a fallback after the page has been rendered On Jun 10, 9:45 pm, Jose Figueras <[EMAIL PROTECTED]> wrote: > To add i18n support for my website's images I use this folder tree: > > /images/ [non i18n images, perhaps fallback images] > /images/en/ [english images] > /images/es/ [spanish images] > ... > > On every image request (from <img ...> tag inside my HTML pages) I > need to change image's URLs between i18n and non i18n variants. > > So, if my HTML page includes: > > * <img src="/images/en/one.png" /> then I must to check If this > image exists at "/images/en/"; if not, I must to change "magically" > current URL to "/images/one.png" > > * <img src="/images/one.png" /> then I must to check If this image > exists at current language version, on "/images/[language]/"; if yes, > I must to change "magically" current URL to "/images/[language]/ > one.png" > > How can I to "trap" requests (middleware, routes, wsgi) to analise and > modify them? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
