To help myself developing the international part of this blog, I've made some usage scenarios, which I write down here, partly to not forget them but mostly to help find any mistakes and omissions. So here they are:

The users:

  • Giannis (Greek, computer savvy user, has his browser correctly set)
  • Takis (Greek, lives abroad, doesn't have access to the language settings)

I could also define two English users in similar situations, but there's no point as it turns out that they just mirror each other.

I have to point out a seemingly little-used preference of web browsers, the language selection preference. This sets the HTTP header 'Accept-Language' so that a server can know, erm, the language preference. This is basic stuff but not many users bother to change from the default setting.

URLs and design

The pages:

  • /el/1/ Direct link to a greek page, content isn't available in english.
  • /en/2/ Direct link to an english page, content isn't available in greek.
  • /el/3/ Direct link to a greek page, content is available in english.
  • /en/3/ Direct link to an english page, content is available in greek.

Also, there are two little flags on the top right of the site that allow a user to explicitly select the language of his choice. I think that this is the standard way to provide language selection. I don't quite like drop-downs, as you have to deal with how to provide the language name (in English? in the same language?). Flags are unobtrusive, universal (to those who care), and don't take up much space.

Expected results

The expected results:

Giannis, Takis having selected greek:

  • /el/1/ - Everything in greek.
  • /en/1/ - Menu in greek, content in greek, notification (greek) that the content isn't available in english.
  • /el/2/ - Menu in greek, content in english, notification (greek) that the content isn't available in greek.
  • /en/2/ - Menu in greek, content in english.
  • /en/3/ - Menu in greek, content in english, notification (greek) that the content is also available in greek.
  • /el/3/ - Everything in greek.

Takis, Giannis having selected greek:

  • /el/1/ - Menu in english, content in greek.
  • /en/1/ - Menu in english, content in greek, notification (english) that the content isn't available in english.
  • /el/2/ - Menu in english, content in english, notification (english) that the content isn't available in greek.
  • /en/2/ - Everything in english.
  • /en/3/ - Everything in english.
  • /el/3/ - Menu in english, content in greek, notification (english) that the content is also available in greek.

When Giannis selects greek and Takis selects english, there are no changes.

Algorithm

So a pattern emerges:

  • The language part of the url defines the language of the content and
  • The browser preference defines the language of interface (menu and messages)

Also, the browser preference determines the language of the root page ( ie. orestis.gr/, without a following language code). A visit to the root page actually returns a redirect.

Conclusion

I think that this is a sound approach: If we try to be RESTful and Google friendly, a unique resource is named with a unique URL: The URL part define the language of the content. There is a slight anomaly when the content isn't available in all languages, where I consider bad manners to give a 404, so I just display the alternate version.

Is there a better way to handle this ? Please leave your comments!

May 13, 2007, 5:43 a.m. More (586 words) 0 comments Feed
Previous entry: How to add a preview page
Next entry: Going International, pt. 3: Implementation of multilingual content

This post is older than 30 days and comments have been turned off.