Multilingual site development: Part I language detection

The writing of this post has been on my back-burner for months now. In fact, ever since the I re-implemented Anna’s comic’s publishing system. I was finally kicked into documenting what I did by Asterisk’s latest post. I’ll probably write a series of entries dealing with the development of multilingual sites. I won’t concentrate on the usability issues that are inherent as there is already much documentation and discussion on such matters.

These posts will be much more technical and dig into how we can possibly implement multi-lingual sites that work without splash-pages (select your language before proceeding) or users ending up on pages in gobbly-gook (from their perspective) and hunting for a link to switch languages with. So, on with the techical details and nit-picking.

Continue reading

The Life of Jalo updated

To honour the upcoming first birthday of Jalo we created a new layout for his photoblog. The layout is a shift away from the darker and heavier look and Anna certainly had fun creating the banner at the top. Below are screenshots of the old and new layouts.

Old layout
New layout

In the more geeky news, the Atom feed of the photoblog was updated to conform to the new Atom 1.0 specification (even if it isn’t approved yet). In getting the feed to validate Niels Lenheer’s listing of changes between 1.0 and 0.3 would have been helpful. Well, reading the spec works just as well though.

Power Metal

The latest issue of Guitar World finally told me what the musical genre that I listen to most is called: Power Metal. I picked up the magazine on a whim, just for the fun of it and an opportunity to drool over nice guitars and various gadgets. The history of Power Metal was just an article that might be worth reading.

It’s odd how my musical taste has remained in the same genre for so long. Even though I listen to a fairly varying playlist (I blame my dear wife Anna for Enrique Iglesias and Sarah Brightman), it’s mostly some classics and modern power metal. When talking about classics, I know I’m odd. I’ll gladly ignore and forget the Beatles, Doors, Rolling Stones, etc. But give me Queen, Alice Cooper, Bruce Springsteen, and Eppu Normaali anytime. They’re my classics.

While the list of Power Metal bands in Wikipedia has just a few of my favorites, the GW article listed even more of my long-time favorites. I guess I’ve always been a fan of a heavier guitar sound and clean vocals. Most metal genres feature vocals that are far from clean and clear, death metal is something I can’t even stand. But I was surprised to see Dream Theater in the list of Power Metal bands in GW.

But now I know: I listen to Power Metal and am proud of it. Let Nightwish, Stratovarius, Sonata Arctica, and the lot play often and loud on my playlist.

On a semantic web and knowledge representation vein of thought: how do you define what bands belong into which music categories. One of my largest challenges lately has been in defining what is blues and what’s rock. The same problem lies behind many other categorizations. After all, books are sorted into thrillers, romance, fiction, non-fiction, children, and a whole list of categories. A mortar-and-bricks store can store each title (be it an album, book, or movie) in one category which makes finding the product quite hard at times.

But web-based system have a much easier time, after all, we can have a blog entry in multiple categories and it can be found through each of them. But why do many applications still insist that only one category can be set for a title? Or why do all photogallery applications only allow a picture to belong to one category (more on this sometime later)?

Using multiple categories can be helpful when looking for related material, but pre-defined categories are always limiting and problematic for everyone, including the person creating the categories. Ready made categories should offer guidelines on deciding which categories are appropriate for an entry, but there is always room for interpretation. And how about situations where a title has multiple layers which can differ significantly? I presume this is one of the reasons that folksonomies, or tags and keywords, have become so popular lately. They are not bound by an ontology (or vocabulary) that someone else has defined.

I really should start getting my thoughts in order on semantics, folksonomies, and galleries before I start rambling too much here…

Secure PHP

For all of you out there who are writing PHP code, I suggest reading Writing secure PHP and its part 2 by Dave.

I also strongly recommend using something like the quote_smart-function described in the PHP documentation (scroll down to example 3) when saving user input in the database.

The importance of writing secure code cannot be emphasized enough. Even if you’re writing a helper application for yourself someone, somewhere might try to crack it. And practising secure programming in even small projects will help you when you work on larger and more important projects. It’s all about the discipline.

A decade (or so)

During the last couple of months I’ve written several versions of my resume for various job applications. Some of which I’ve submitted, some which I haven’t, and some that I’m still thinking about. But in all of them I’ve noticed one recurring theme. It’s already a bit over a decade from when I made my first web page.

Try as I might I can’t remember exactly when my first foray into HTML and the web development was submitted to public scrutiny. I remember that it was in the autumn of 1994 when a friend of mine got his own server in the University of Joensuu’s network and gave me a user account on it (it was an old DEC). Initially I used it for email and IRC, but soon I heard of this new thing called the World Wide Web. I was a senior in high school at the time. And one of the class nerds (both of us are in IT still).

It’s a odd feeling to be under thirty and think back at the old days. I won’t say good old days. But there is a lot of Internet history that I remember. But what I remember most is when I really started to fiddle around with web development and tried to figure out what can and can’t be done with HTML. At that time HTML 2 was out, HTML 3.2 was being worked on and emerging, and Internet Explorer 3.0 was already making a mess of things. Yes, we’re talking about late 1996/early 1997 here.

Even then I felt that open standards as those created by the W3C were the only way to go. After all, I was living strongly in Linux land at the time and none of the fancy plugins were available to me (even thought they were created for Netscape). The browser wars were a no-brainer for me. My choice was clear — Netscape and later on Mozilla. Yes, I complied the first versions available — no, I haven’t hacked at the code.

From Mozilla I switched to Galeon and back to Mozilla for several times. I tested Opera every now and then (but it had those stupid ads…). When Phoenix first came out I tested it and went back to whatever I was using at the time. When Phoenix changed to Firebird I was just about ready to switch. Slightly before the change from Firebird to Firefox I made my final switch to the current browsing configuration I have now: Firefox for everything except the odd test in Internet Explorer (various versions).

I was active in upgrading my browser to the latest version available – if only to try to get CSS support to work a bit better. I remember working on my first CSS sites in 1998 and cursing the stupid browsers that didn’t support it well enough. I’ve been an early adopter all the time and learned the standards the hard way: by reading the specs and trial-and-error.

I won’t even go to all of the various versions of my homepages that I’ve built. The first version was very early-web: a single picture of me and some text with links. When I started browsing the web more, the amount of links increased and there was even some more content. Back then no-one really cared about privacy so much — usernames and finger data were readily available. I also remember the days of table-based layouts (out of necessity, see above) and images as menu buttons. And weird backgrounds. But I was never guilty of Comic Sans or blinking text. I do have some sort of taste ;)

The current wave of CSS-based design with clean and usable interfaces is a joy for me. I still cringe at the thought of most sites in the late 90s. The web has come a long way in the last decade — both content and design wise. I can just wait to see what the next decade will bring. And maybe I’ll get my fingers and brain in gear and do something about the future myself as well.