22
Mar
10

Easy Multilingual Theming with XDV

I use Plone at work (and love it). Lately I’ve started getting into using XDV to theme my sites (3 so far). It’s fantastic. Our latest site was put up in a week (from start to finish) using Plone, collective.xdv and some team work. Anyways, we only had the English version up initially, while we waited on the translations. When they finally came through, I first plugged it all into Plone (using LinguaPlone), but now I had to update the theme to support the French site. Support for the :lang() CSS pseudo selector is lacking in some browsers, so I contemplated for a few minutes, then added 2 rules to my rules.xml file:

<drop theme="//*[@lang='fr']" if-content="/html[@lang!='fr']" />
<drop theme="//*[@lang='en']" if-content="/html[@lang!='en']" />

Problem solved! To handle language-specific CSS, I just created 2 new css files, one for English and one for French and added a lang attribute in the link element.

<link lang="en" href="style-en.css" rel="stylesheet" type="text/css" />
<link lang="fr" href="style-fr.css" rel="stylesheet" type="text/css" />

I did the same thing for static text and images as well.

Advertisement

0 Responses to “Easy Multilingual Theming with XDV”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


March 2010
M T W T F S S
« Dec    
1234567
891011121314
15161718192021
22232425262728
293031  

Follow

Get every new post delivered to your Inbox.