Basic Bilingual Plugin [en]

This is a simple plugin which wraps together my bilingual hacks to make day-to-day posting less of a hassle.

[fr] Ce plugin pour WordPress regroupe les hacks que j'utilise depuis un moment déjà pour gérer le bilinguisme de mon weblog. Il permet d'afficher un sommaire de chaque billet dans "l'autre langue" et d'appliquer un formattage par langue via l'attribut lang.

Plus de détails sur la page officielle du plugin.

**Update 01.02.2007:** This plugin broke badly with WordPress 2.1, but [has now been (hopefully) updated](http://climbtothestars.org/archives/2007/02/01/basic-bilingual-and-bunnys-technorati-tags-plugins-updated-for-wordpress-21/). The wiki page on wp-plugins.org is frozen and may not be up-to-date anymore. [Download here.](/code/basic-bilingual.zip)

This post is the test run for my Basic Bilingual plugin.

It doesn’t add much functionality to what I already have through my hacks, but it’s cleaner from a code point of view, and it’s portable — you can use it too if you wish.

Be patient if the wiki page isn’t exactly up-to-date. It will be shortly — and the plugin will be available through the Plugin Manager as soon as I’ve made sure it’s functional enough (ie, when I press publish and hell doesn’t break loose).

This plugin basically allows you to do what you can see on this weblog: add lang attributes to your posts, excerpts in “the other language”, and localize the date. It also creates permanent fields in the admin pages for entering the language and “other language excerpt” easier.

I’d like to emphasize that this plugin is very simple. It is in no way a replacement of any sort for the larger-scale multilingual efforts going on these days. I wanted to get my code cleaned up and my hacks back in the admin interface (I lost them when I upgraded WP), and I’m making the result public.

Similar Posts:

IT Conversations: Dan Gillmor [en]

Some notes on IT Conversations show with Halley Suitt and Dan Gillmor (audio available online).

[fr] Interview audio de Dan Gillmor par Halley Suitt. Quelques notes.

I’m currently listening to Halley’s interview of Dan Gillmor on IT Conversations. I’m not used to listening to stuff through the internet (the whole podcasting hype hasn’t really caught my interest… yet) — so here are a few notes and comments, mainly for myself.

First of all, I’m always slightly shocked to hear people I know from the Internet actually speaking. When chatting, or reading blogs, I forget that people have accents. So, my first reaction upon hearing Halley speaking was “Gosh! She really has an American accent!”.

After a first part on American politics that went completely over my head, the topic turned to “Journalism and blogging” (already more interesting) and finally, more webby stuff. A few random notes:

  • Strive for objectivity in journalism still a valid aim.
  • 9-11, elections, tsunami: made blogs visible as a media, rather than “made more people blog” (I’ve finally managed to name the confusion that irritates me so much.)
  • Camera phones (and digicams in general) have a highly disruptive potential. Towards more transparency. Harder to hide nasty things.
  • Podcasting: most people not trained to produce the kind of audio we enjoy listening to.
  • Blogs with small readership (target audience=family and close friends): very important sociologically.
  • Internet allows to bring readers closer to source material.
  • Probably lots of source material for historians gathering now on the web. Web stuff as potential replacement for the letter, which used to give lots of information on people’s lives and current events. (Biographies, History.)
  • Not holding people accountable (in future) about silly things they wrote on their teenage blogs…
  • About writing the book online: retaining authorship, while having thousands of “eyes” to give feedback and comments. (And the eyes in question will be those interested by the topic.)

Next one I’m listening to is Joi’s.

Similar Posts:

Hosted Blog Platform Test Write-Up [en]

I’ve tested 13 free platforms, and this is a write-up on the experiment. The ones I preferred were Blogsome, running Wordpress, and Mon-Blog (in French), running DotClear.

Edit 26.12.2006: For those of you trying to choose a free blogging platform, I’ve now been recommending WordPress.com without hesitation for some time now.

As the people I hang out with on Freenode are painfully aware of by now, I’ve been on a blog platform testing binge. In total, 13 free* platforms tested. Here is a quick list of my test blogs — you’ll find detailed comments about each platform on the test blogs themselves, and a general overview below. The ones I preferred were Blogsome and Mon-Blog.

The platforms were tested with FireFox 1.0 on OSX, Javascript enabled, set to block pop-ups and force links opening a new window to open in the initial tab/window (we’ll see this setting seems to have caused problems with many visual editors).

My main interest was to have a peek at what existed (personal curiosity) and see if it was possible to claim the blogs on Technorati. What follows is an account of my personal user experience on these different platforms. It is not the result of a battery of systematic “benchmarking tests”, though here are some of the points I paid attention to:

  1. was it easy to create an account, or did I have to fight?
  2. how easy was it for me to sign back in, afterwards?
  3. overall, did I find the features I expect from a weblog? (note how subjective that is)
  4. how did writing a post go?
  5. could I add images?
  6. could I change the template?
  7. could I add links to my other test blogs? (linkroll management)
  8. could I claim the blog as mine at Technorati?
  9. did I bump into availability problems?

Lets get the last point over with first. I succeeded in claiming blogs on all platforms except three: NRJ blogs, Skyblog, and LiveJournal. The reason for that is that the last two platforms limit links in the blogroll to weblogs using the same platform. This prevented me from using the blogroll to add the Technorati code necessary to claiming the weblog.

Note, by the way, that I am talking about the free version of LiveJournal, as the paid version does not have this limitation. NRJ blogs, by far the worst platform amongst those tested, does not permit linking at all (even in posts!) I’m not even sure if it deserves to be called a “blogging platform”.

As far as linkrolls or blogrolls are concerned, ViaBloga gets top marks for their “almost-automatic linkrolling”. You can simply type in the URL of the blog/site you want to add, and it retrieves title and rss feed, and also creates a screenshot and thumbnail of the site. It really makes you want to add links to your sidebar. One-click blogrolling, if you like. Otherwise, most link management systems are pretty standard.

Some, like MSN Spaces, make you click “Add Link” between each links, instead of systematically presenting you with a form allowing you to add a link each time you go in link management. This is one of the minor but irritating usability problem which plague MSN Spaces. There are major ones too, but I won’t list them too (no paragraph breaks for me, login problems, timeout problems, clunky interface, ugly permalinks, horrible markup) — they are detailed on my test MSN Space.

Visual editors are neat when they work, but they are a great pain when they do not work. Because of my browser settings, I failed adding links to my posts at ViaBloga, for example. I also failed to add photographs at CanalBlog, HautEtFort, and 20six because of this. BlogSpot is clear enough about the fact you need an external service like Flickr if you want photos on your blog, and both LiveJournal and U-blog seem to fail the photo test for various reasons.

Both Skyblog and NRJ blogs are very limited blogging services, the latter being a very pale imitation of the former. Skyblog focuses on making it easy for teens to put photos on the web with brief comments, and, despite many other shortcomings (no permalinks, interface issues, server overload at peak times), I’m forced to admit it does it pretty well — which partly explains its success (it’s the main French language blog platform in blog numbers). The other services passed the photo test with more or less ease (don’t forget I’m a geek, so uploading a photo first, copying the URL and inserting it into a post isn’t an issue for me — it could be for some).

At some point, I had trouble connecting to the following services (or timeouts): Skyblog, MSN Spaces, and 20six (I can’t remember any others, but my memory might be failing me. NRJ blogs distinguishes itself by refusing to publish certain posts, or waiting a day or two before being so.

Now, before I get lost in random comments, I’ll give you a quick low-down on each of the solutions tested, as well as links to other people who have recently reviewed some of them.

Blogsome
  • Pros: WordPress, very easy to sign up
  • Cons: might need to be a bit of a techie at times

Being an avid and enthusiastic WordPress user, the idea of a hosted WordPress-powered blogging platform was very exciting to me. No bad surprises as I already knew the interface (I’m biased, of course), and no major bugs that couldn’t be addressed after posting about them in the forum. I didn’t try the visual editor there, but I assume it will make it more newbie-friendly. Definitely the platform I recommend for the moment.

MSN Spaces
  • Pros: none
  • Cons: way too beta (buggy)

After Roland Tanglao, Robert Scoble, and a dirty word test at Boing Boing, let me add my two cents by saying I am unenthusiastic about MSN Spaces. It’s still way too rough around the edges. Not usable as far as I’m concerned.

LiveJournal
  • Pros: community, well-established
  • Cons: lots of settings, limitations of free accounts (no Technorati claim possible)

Well, LiveJournal is LiveJournal, and I know that to get a good idea of what it can do you need the paid version. My first impression was that it seemed to have lots of options in the admin part (a bit confusing), but other than that, it was pretty easy to get going and posting. Google will point out to you many more complete reviews of LiveJournal, so I’ll stop here. My main point was, however, to see if I could claim a free LiveJournal as my blog at Technorati, and that was not possible (short of adding the code via JavaScript in the head of the page, but honestly, I wouldn’t want to go that far for my test.)

BlogSpot
  • Pros: well-established, nice admin interface
  • Cons: lack of categories, trackbacks, and image hosting

No big surprise here. I used Blogger for years (though not BlogSpot), and I liked the interface I found during my test a lot. They should wake up and get categories and trackbacks though. We’ll be in 2005 in less than 3 weeks. A good, solid option for people who can live without categories, trackbacks, and hosted photographs.

ViaBloga*
  • Pros: great link management, wiki-like features, active development
  • Cons: some usability issues and minor bugs; not free

ViaBloga has many good features. The “configurable blocs” system (invented by Stéphane for Joueb.com), which allows you to easily move about elements of your page, is just great (once you’ve figured it out). The platform has real wiki-like capability via keywords, and “cross-links”, which work like a kind of automatic trackbacking system. On the shortcomings side, I would say that although the features are great, the usability and user-friendliness of the administration aspect, which is a little confusing, could still be improved. I’m not a beginner, and it took me quite some time to figure out a certain number of things (and I know Stéphane and Delphine, so it’s easy for me to get direct help). And no, it’s not just because I’m “used” to other systems — I should still be able to figure things out easily.

Joueb
  • Pros: well-established, community
  • Cons: community (!), some usability problems (cf. ViaBloga)

Joueb is ViaBloga’s community-oriented little sister. The first French language hosted blogging platform seemed to me a little more kludgy than ViaBloga, but there is a happy community there, and Stéphane is an active developper, always ready for feedback and making improvements to his babies. If you’re looking for a French weblogging platform with a strong community, I’d say this is a good choice.

Skyblog
  • Pros: great if all you want is upload your phone photos, spit out a comment, and allow people to comment (though Flickr does it better)
  • Cons: no permalinks or trackbacks, limited server availability, teen-sms-talk and link-whoring comments

I remember when Skyblog was launched, the francoblogosphere was boiling over in horror at this kind of bastardized blogging solution where teens posted pics of their friends and commented in sms-speak. (Sorry, can’t find any posts right now, will add links later if I do.) As I said, Skyblog does not do much, but it makes publishing photos and short texts easy, and it’s pretty successfully targeted at a certain audience. My pupils have Skyblogs and they are obviously all the rage. Lots of photos, hardly any text, and comments abound which either say “ur 2 kool”, “u suck”, or “com visit my sky http://somecoolnick.sykblog.com/”. Not very interesting as a blogging platform, as far as I’m concerned, but obviously successful.

NRJ blogs
Edit 18.12.04: it seems confirmed that NRJ blogs hasn’t launched yet, and Google caught them by surprise.

  • Pros: none
  • Cons: sucks (I mean, some posts don’t even get posted, and finding your blog URL demands a thorough investigation)

I’ll say it loud and clear, NRJ blogs suck, and as a pretty obvious consequence they aren’t taking off really well: less than 50 blogs created since they launched (and NRJ is a major popular radio!) However, I can’t find a link on their home page, so there is a possibility this was a preliminary soft launch. In any case, I’m getting my few days of fame as an NRJ blog star. Neuro, Mr_Peer, and Kwyxz also tried NRJ blogs and were all but impressed. See their posts or my test blog for detailed complaints.

CanalBlog
  • Pros: has the usual set of features you expect from a blog
  • Cons: admin interface can feel a little rude at times

CanalBlog was a pleasant surprise. The admin interface takes over your browser, but it works pretty well and it’s user friendly enough in a “MS-Office-lookalike” way. The layouts you can choose from are clean, and they have comments and trackbacks. They have ads, though. I’d say they are a viable platform (er… a viable choice of platform).

HautEtFort
  • Pros: nice admin interface
  • Cons: no trackbacks

Too bad they don’t have trackbacks! I like what I’ve seen of the admin interface, nice and clean and uncluttered. As many other platforms do, they force me to go through the home page to log in (which I dislike), but honestly, like CanalBlog (and maybe more, if it wasn’t for the lack of trackbacks), I’d say they are an honest French language blogging platform.

20six
  • Pros: has the set of features you expect from a blog
  • Cons: ugly, cluttered admin interface, server downtime

I really didn’t like 20six. I find their layouts ugly, the admin interface is hell, and their server was unavailable for hours at one point when I was about to do my photo upload test. Even though they know what trackbacks are, I wouldn’t recommend them (go CanalBlog instead).

U-blog
  • Pros: community, features more or less ok
  • Cons: probably doomed

Well, I’ve spoken a lot about U-blog already, but more in a blogo-political context. When there weren’t so many French language blogging platforms around, U-blog used to be my recommendation. On trying it now, I can’t help saying that it feels a little broken, or abandoned. I was faced with an error when trying to upload a picture, and some of the links in the admin section tell you that this or that feature is only available with the paid version. Given the platform doesn’t seem in active development anymore, I wouldn’t recommend it.

Mon-Blog
  • Pros: DotClear (clean, beautiful, all functionalities)
  • Cons: launched three days ago

Now this, ladies and gentlemen, was a last-minute and very pleasant surprise. Mon-Blog is based on the weblog engine DotClear, which I have long held in high regard. For the first time, I’ve had a chance to see the DotClear admin interface, and let me tell you, it’s as beautiful as the themes they provide to dress your weblog in. Nothing really missing feature-wise, though it seems templates won’t really be customisable at Mon-Blog for the moment. The service has just launched and some creases need ironing out, but the forums and the developer are reactive. Just go for it. This is clearly my first choice for a French blogging platform.

I hope this will have been of interest to some. Thanks for your attention, and I’m glad to be over with the testing!

Edit 16:20: I’ve just add quick pros/cons bullet points (thanks to acrobat for the suggestion and the proof-reading).

Edit 13.12.04: ViaBloga was included in this survey although it is not a free platform. It is free for non-profit organisations, however. The mistake is mine — being an early tester, I was offered six months free, and in my mind had not switched ViaBloga to the “paying platforms” category. See my comment and Stéphane’s on the subject.

Similar Posts:

Testing Hosted Blog Solutions [en]

I’ve set up a few test blogs on various hosted blogging farms. Nasty feedback for some of them.

[fr] J'ai ouvert des blogs-tests à  divers endroits qui offrent blogs et hébergement. Voici une liste de mes blogs-tests avec quelques commentaires.

I’ve started setting up test blogs here and there to try out hosted blogging solutions, as I’m eager to encourage people to start blogging, but I’m aware that getting server space, a domain, and installing WordPress isn’t something the casual user will do.

So, very brief review here, more details on the blogs themselves (which tend to be lists of complaints and problems I ran into while functioning in my lazy-lambda-user mode).

ViaBloga

My test blog is Chez Steph. ViaBloga is a cousin of Joueb.com, minus the community emphasis, which appears repulsive to some. (Think LiveJournal.)

I’ve run into a few bugs and usability problems there, which have always been quickly responded to and addressed by the staff. I should add that I’ve known Delphine and Stéphane for quite some time now, and that the latter personally asked me if I was interested in testing ViaBloga when they were starting with it.

ViaBloga has got wiki-like features I haven’t really managed to get into. One thing that really has me enthusiastic (and I discovered that today) is the list management system. Just add the url, it fetches the title of the link, the rss feed, and creates a thumbnail. Here is an example of what it can look like — look at Delphine’s blogroll, too. I’d love to see something like this rolled into a plugin for WordPress — it makes me feel like adding all sorts of links to my blog.

Skyblog

I’ve decided to go public with my skyblog, and I hope you appreciate my courage. Skyblog is clearly aimed at a very young public (teens), and even the language in the admin interface reflects that. Many of my pupils have skyblogs on which they post photos of their friends and make brief comments in sms-talk.

I find the blogs themselves ugly, and the admin interface is kludgy, though it seems it works, because my pupils always complain that WordPress is so hard to use and that skyblog is so much better and easier. One thing to be said, skyblog makes it really easy to upload photographs, so many of these skyblogs ressemble a vaguely commented photo album.

I hardly posted anything to my test blog, and upon checking it out again today I was amazed at the amount of (a) visits (nearly 1000) it had had, and (b) nasty aggressive comments complete strangers had left me. I’ve added a photo of my cat, I wonder what the reaction to that will be.

Blogsome

Blogsome is clearly my favourite. Here is my Blogsome test blog, complete with a Pink Lilies theme. It took me less than 30 seconds to open my weblog (a username, an e-mail address, and a title for the weblog — done.)

It’s WordPress, so I’m in known territory, and I’ve been busy posting bugs and comments in the forums. Blogsome is still young, and my biggest gripe for the moment is the caching problems — for example, changes to the template or links are not immediately reflected on the blog (though “publishing” a post helps).

If you’re looking for a free hosted blogging solution right now, Blogsome is the one I would recommend, along with Blogger, of course. I used Blogger for years, before Blogspot existed. I left mainly because it lacked certain features I wanted (like categories) — and I’d say that still now, it’s a little bit poor on the feature side. But it’s a good, reliable service which has been around long enough to be trusted without too many second thoughts.

MSN Spaces

I just opened a test blog at MSN Spaces. My first two posts complain quite a bit (my biggest gripe for the moment being that it doesn’t convert line breaks into paragraphs — a showstopper, if you ask me). My positive experience was changing the template — that worked fine.

So, if you’re interested, keep an eye on those blogs. I’m always happy to try things out and complain about all the problems I run into.

Edit 06.12.04: Got another test blog at NRJ blogs — though in my opinion you can barely call it a blog. I had to log out to figure out what my blog address was, and it seems totally impossible to make outgoing links. Keep an eye on the individual test blogs for comments on the different systems.

Edit 2: OK, got one at CanalBlog too. The admin interface completely takes over the browser, but it seems really usable (I didn’t run into any problems!) and the default layout is clean enough. Just an ad banner on top. That’s enough for tonight, folks!

Edit 3, 07.12.04: Add a 20six.fr test blog to the list. Follow-up post coming.

Edit 4: HautEtFort, and I think I’m done with creating test blogs. Gah.

Edit 5, 08.12.04: Hopefully the last bunch, but you never know. I seem to be suffering from some obsessive-compulsive blog opening disorder. LiveJournal, BlogSpot, Joueb and U-blog. Have I forgotten someone? I count 12 test blogs. Now let me go and update all my blogrolls.

Edit 6: A fresh new French service, open since yesterday: Mon-Blog.org, based on DotClear.

Similar Posts:

Life and Trials of a Multilingual Weblog [en]

Here is an explanation of how I set up WordPress to manage my bilingual weblog. I give all the code I used to do it, and announce some of the things I’d like to implement. A “Multilingual blogging” TopicExchange channel is now open.

[fr] J'explique ici quelles sont les modifications que j'ai faites à WordPress pour gérer le bilinguisme de mon weblog -- code php et css à l'appui. Je mentionne également quelques innovations que j'ai en tête pour rendre ce weblog plus sympathique à mes lecteurs monolingues (ce résumé en est une!) Un canal pour le weblogging multilingue a été ouvert sur TopicExchange, et vous y trouverez peut-être d'autres écrits sur le même sujet. Utilisez-le (en envoyant un trackback) si vous écrivez des billets sur le multinguisme dans les weblogs!

My weblog is bilingual, and has been since November 2000. Already then, I knew that I wouldn’t be capable of producing a site which duplicates every entry in two languages.

I think this would defeat the whole idea of weblogging: lowering the “publication barrier”. I feel like writing something, I quickly type it out, press “Publish”, and there we are. Imposing upon myself to translate everything just pushes it back up again. I have seen people try this, but I have never seen somebody keep it up for anything nearing four years (this weblog is turning four on July 13).

This weblog is therefore happily bilingual, as I am — sometimes in English, sometimes in French. This post is about how I have adapted the blogging tools I use to my bilingualism, and more importantly, how I can accommodate my monolingual readers so that they also feel comfortable here.

First thing to note: although weblogging tools are now ready to be used by people speaking a variety of languages (thanks to a process named “localization”), they remain monolingual. Language is determined at weblog-level.

With Movable Type, I used categories to emulate post-level language awareness. This wasn’t satisfying at all: I ended up with to monstrous categories, Français and English, which didn’t help keep rebuild times down.

With WordPress, the solution is far more satisfying: I store the language information as Post Meta, or “custom field”. No more category exploitation for something they shouldn’t be used for.

Before I really got started doing the exciting stuff, I made a quick change to the WordPress admin interface. If I was going to be adding a “language” custom field to each and every post of mine, I didn’t want to be doing it with the (imho) rather clumsy “Custom Fields” form.

In edit.php, just after the categorydiv fieldset, I inserted the following:

<fieldset id="languagediv">
      <legend>< ?php _e('Language') ?></legend>
	  <div><input type="text" name="language" size="7"
                     tabindex="2" value="en" id="language" /></div>
</fieldset>

(You’ll probably have to move around your tabindex values so that the tabbing order makes sense to you.)

I also tweaked the wp-admin.css file a bit to keep it looking reasonably pretty, adding the rule below:

#languagediv {
	height: 3.5em;
	width: 5em;
}

and adding #languagediv everywhere I could see #poststatusdiv, so that they obeyed the same rules.

In this way, I have a small text field to edit to set the language. I pre-set it to “en”, and have just to change it to “fr” if I am writing in French.

We just need to add a little piece of code in the form processing script, post.php, just after the line that says add_meta($post_ID):

 // add language
	if(isset($_POST['language']))
	{
	$_POST['metakeyselect'] = 'language';
        $_POST['metavalue'] = $_POST['language'];
        add_meta($post_ID);
        }

The first thing I do with this language information is styling posts differently depending on the language. I do this by adding a lang attribute to my post <div>:

<div class="post" lang="<?php $post_language=get_post_custom_values("language"); $the_language=$post_language['0']; print($the_language); ?>">

In the CSS, I add these rules:

div.post:lang(fr) h2.post-title:before {
  content: " [fr] ";
  font-weight: normal;
}
div.post:lang(en) h2.post-title:before {
  content: " [en] ";
  font-weight: normal;
}
div.post:lang(fr)
{
background-color: #FAECE7;
}

I also make sure the language of the date matches the language of the post. For this, I added a new function, the_time_lg(), to my-hacks.php. I then use the following code to print the date: <?php the_time_lg($the_language); ?>.

Can more be done? Yes! I know I have readers who are not bilingual in the two languages I use. I know that at times I write a lot in one language and less in another, and my “monolingual” readers can get frustrated about this. During a between-session conversation at BlogTalk, I suddenly had an idea: I would provide an “other language” excerpt for each of my posts.

I’ve been writing excerpts for each of my posts for the last six months now, and it’s not something that raises the publishing barrier for me. Quickly writing a sentence or two about my post in the “other language” is something I can easily do, and it will at least give my readers an indication about what is said in the posts they can’t understand. This is the first post I’m trying this with.

So, as I did for language above, I added another “custom field” to my admin interface (in edit-form.php). Actually, I didn’t stop there. I also added the field for the excerpt to the “simple controls” posting page that I use (set that in Options > Writing), and another field for keywords, which I also store for each post as meta data. Use at your convenience:

<!-- BEGIN BUNNY HACK -->
<fieldset style="clear:both">
<legend><a href="http://wordpress.org/docs/reference/post/#excerpt"
title="<?php _e('Help with excerpts') ?>"><?php _e('Excerpt') ?></a></legend>
<div><textarea rows="1" cols="40" name="excerpt" tabindex="5" id="excerpt">
<?php echo $excerpt ?></textarea></div>
</fieldset>
<fieldset style="clear:both">
<legend><?php _e('Other Language Excerpt') ?></legend>
<div><textarea rows="1" cols="40" name="other-excerpt"
tabindex="6" id="other-excerpt"></textarea></div>
</fieldset>
<fieldset style="clear:both">
<legend><?php _e('Keywords') ?></legend>
<div><textarea rows="1" cols="40" name="keywords" tabindex="7" id="keywords">
<?php echo $keywords ?></textarea></div>
</fieldset>
<!-- I moved around some tabindex values too -->
<!-- END BUNNY HACK -->

I inserted these fields just below the “content” fieldset, and styled the #keywords and #other-excerpt textarea fields in exactly the same way as #excerpt. Practical translation: open wp-admin.css, search for “excerpt”, and modify the rules so that they look like this:

#excerpt, #keywords, #other-excerpt {
	height: 1.8em;
	width: 98%;
}

instead of simply this:

#excerpt {
	height: 1.8em;
	width: 98%;
}

I’m sure by now you’re curious about what my posting screen looks like!

To make sure the data in these fields is processed, we need to add the following code to post.php (as we did for the “language” field above):

// add keywords
	if(isset($_POST['keywords']))
	{
	$_POST['metakeyselect'] = 'keywords';
        $_POST['metavalue'] = $_POST['keywords'];
        add_meta($post_ID);
        }
   // add other excerpt
	if(isset($_POST['other-excerpt']))
	{
	$_POST['metakeyselect'] = 'other-excerpt';
        $_POST['metavalue'] = $_POST['other-excerpt'];
        add_meta($post_ID);
        }

Displaying the “other language excerpt” is done in this simple-but-not-too-elegant way:

<?php
$post_other_excerpt=get_post_custom_values("other-excerpt");
$the_other_excerpt=$post_other_excerpt['0'];
if($the_other_excerpt!="")
{
	if($the_language=="fr")
	{
	$the_other_language="en";
	}

	if($the_language=="en")
	{
	$the_other_language="fr";
	}
?>
    <div class="other-excerpt" lang="<?php print($the_other_language); ?>">
    <?php print($the_other_excerpt); ?>
    </div>
  <?php
  }
  ?>

accompanied by the following CSS:

div.other-excerpt:lang(fr)
{
background-color: #FAECE7;
}
div.other-excerpt:lang(en)
{
background-color: #FFF;
}
div.other-excerpt:before {
  content: " [" attr(lang) "] ";
  font-weight: normal;
}

Now that we’ve got the basics covered, what else can be done? Well, I’ve got some ideas. Mainly, I’d like visitors to be able to add “en” or “fr” at the end of any url to my weblog, and that would automatically filter out all the content which is not in that language — maybe using the trick Daniel describes? In addition to that, it would also change the language of what I call the “page furniture” — titles, footer, and even (let’s by ambitious) category names. Adding language sensitivity to trackbacks and comments could also be interesting.

A last thing I’ll mention in the multilingual department for this weblog is my styling of outgoing links if they are written in a language which is not my post language, using the hreflang attribute. It’s easy, and you should do it too!

Suw (who has just resumed blogging in Welsh) and I have just set up a “Multilingual blogging” channel on TopicExchange — please trackback it if you write about blogging in more than one language!

Similar Posts: