Archive for the 'drupal' Category

Multi-lingual site in Drupal

Thursday, September 20th, 2007

Some time ago a friend of mine asked if I could build a website for him. The requirements were simple: it had to be easy to add content for my non-technical savvy friend, the look and feel should be in line of his record store (he owns and runs 2 records stores specialized in jazz and classical music) and it had to be multilingual, Dutch, French and English. Last requirement was relatively cheap and easy hosting.

After some initial looking around on the web, I thought I’d give drupal a go. I was looking for an excuse to get to know some drupal basics anyway :)

In this post, I’ll describe how I’m setting up this site, especially the multilingual part. I’m still a complete drupal newby, so all suggestions are welcome.

So without further ado, this is what I did. I started with a fresh copy of drupal on the drupal site. I then installed and enabled the following modules:

  • Internationalization
  • CCK
  • Views

In the drupal handbook for the internationalization project, I found an elaborate how-to on getting the whole internationalization thing to work. Key things I learned where:

  • Menus: with the internationalization module, it is possible to have different menus for different languages. This is typically not what you want. You rather want one menu structure with text that changes if you switch languages. Therefor, use the “manage strings” functionality found in Administer -> Site Configuration -> Localization.
  • The menu items should link to node_name, not to en/node. The internationalization module will rewrite the link to en/node_name at runtime when you have the language set to English.
  • Nodes: Make sure to add a language to each individual node, this avoids an occasional piece of content in another language popping up.
  • Enable the path module under the core-optional family of modules. You will need to change the default path of a node to e.g. en/node_name for an English page.
  • Be sure to enable multilingual support for all content types you are using.
  • Do not forget to add the language switcher block to your site ;)

All in all setting up these basic things went smooth, I do have a couple of remarks/questions:

  • Is it possible to automatically set the correct path name e.g. en/node_name, rather then to have to do this manually for each individual node?
  • How can I theme/style the language switcher so that I only have the little flags, not the language name?
  • Are there other tips and tricks, obvious things or deeply hidden features I should be aware about?

All suggestions welcome, thanks in advance!