hi, I have a site developed with CSS. We just translated the site to German. The problem I have is with some embedded graphics. For example: #rightcolumn h1 { background: transparent url("i/news_title.jpg") no-repeat top left; height: 38px; width: 180px; margin: 0; padding: 0; } This is the English graphic. If people are in the German side, I need news_title_de.jpg. But I'm not sure how to deal with this without doing a separate CSS file. Thanks, Jason.
Jason Leach wrote:
hi,
I have a site developed with CSS. We just translated the site to German. The problem I have is with some embedded graphics. For example: #rightcolumn h1 { background: transparent url("i/news_title.jpg") no-repeat top left; height: 38px; width: 180px; margin: 0; padding: 0; }
This is the English graphic. If people are in the German side, I need news_title_de.jpg. But I'm not sure how to deal with this without doing a separate CSS file.
Thanks, Jason.
Jason, Here a simple minded try using: <html> <head> <title tal:content="template/title">The title</title> <tal:test tal:condition="not: python: context.REQUEST.has_key('german','')"> <style type="text/css"> PUT CSS CODE HERE FOR GERMAN IMAGE </style> </tal:test> </head> Just set the request to the language and it should work, David
David H wrote:
Jason Leach wrote:
hi,
I have a site developed with CSS. We just translated the site to German. The problem I have is with some embedded graphics. For example: #rightcolumn h1 { background: transparent url("i/news_title.jpg") no-repeat top left; height: 38px; width: 180px; margin: 0; padding: 0; }
This is the English graphic. If people are in the German side, I need news_title_de.jpg. But I'm not sure how to deal with this without doing a separate CSS file.
Thanks, Jason.
Jason, Here a simple minded try using:
<html> <head> <title tal:content="template/title">The title</title> <tal:test tal:condition="not: python: context.REQUEST.has_key('german','')"> <style type="text/css"> PUT CSS CODE HERE FOR GERMAN IMAGE </style> </tal:test> </head>
Just set the request to the language and it should work,
David
__
More simple-minded than I thot, I missed the point of your question lol. *sorry* David
On 07/06/05, Jason Leach <jason.leach@gmail.com> wrote:
hi,
I have a site developed with CSS. We just translated the site to German. The problem I have is with some embedded graphics. For example: #rightcolumn h1 { background: transparent url("i/news_title.jpg") no-repeat top left; height: 38px; width: 180px; margin: 0; padding: 0; }
This is the English graphic. If people are in the German side, I need news_title_de.jpg. But I'm not sure how to deal with this without doing a separate CSS file.
You could make the CSS a DTML file that checks using <dtml-if>, or you could even make news_title.jpg a python script that writes back an image depending on where the user is from. -- Phillip Hutchings http://www.sitharus.com/ sitharus@gmail.com / sitharus@sitharus.com
Am Montag, den 06.06.2005, 20:51 -0700 schrieb Jason Leach:
hi,
I have a site developed with CSS. We just translated the site to German. The problem I have is with some embedded graphics. For example: #rightcolumn h1 { background: transparent url("i/news_title.jpg") no-repeat top left; height: 38px; width: 180px; margin: 0; padding: 0; }
This is the English graphic. If people are in the German side, I need news_title_de.jpg. But I'm not sure how to deal with this without doing a separate CSS file.
You set some flag for example <body class="de"> ... or <body lang="de> ... Next you first set a default: #rightcolumn h1 { background: transparent url("i/news_title.jpg") ... } Now for each language you just overwrite the specifics: for body class you write: body.de #rightcolumn h1 { ...i/news_title_de.jpg ... } for body lang you write: body[lang=de] #rightcolumn h1 { ...i/news_title_de.jpg ... } (of course you fill the places where I wrote the ... :-) Ah and lets hope your graphic does not contain text - otherwise the fileformat jpg is sure inappropriate.
Tino Wildenhain wrote:
Am Montag, den 06.06.2005, 20:51 -0700 schrieb Jason Leach:
hi,
I have a site developed with CSS. We just translated the site to German. The problem I have is with some embedded graphics. For example: #rightcolumn h1 { background: transparent url("i/news_title.jpg") no-repeat top left; height: 38px; width: 180px; margin: 0; padding: 0; }
This is the English graphic. If people are in the German side, I need news_title_de.jpg. But I'm not sure how to deal with this without doing a separate CSS file.
You set some flag for example <body class="de"> ... or <body lang="de> ...
Next you first set a default:
#rightcolumn h1 { background: transparent url("i/news_title.jpg") ... }
Now for each language you just overwrite the specifics:
for body class you write:
body.de #rightcolumn h1 { ...i/news_title_de.jpg ... }
for body lang you write:
body[lang=de] #rightcolumn h1 { ...i/news_title_de.jpg ... }
Tito, Thats the first example of that logic I've seen Mixing CSS parent-child dependencies and something like: <body tal:attributes lang="request/language | nothing"> When body lang="de" then body.de #rightcolumn h1 { ...i/news_title_de.jpg ... } Kicks in. I like it! David
participants (4)
-
David H -
Jason Leach -
Phillip Hutchings -
Tino Wildenhain