01.06.2010

from one thing to another, the making of

In my first post I mentioned a few of the things I went through to get this site ready. While it’s still fresh in my memory I want to share the process in a bit more details, so I’ll have an account of it for one thing, but also to help others who may want to embark on the journey. Especially the part about making the blog bilingual.

1. The platform. Use wordpress.org for the ability to install plugins and load a customized theme. With wordpress.com you would get a free setup but without the ability to modify the code among other things.

2. The host. I’m using Yahoo!. Other choices for one-step wordpress installation are bluehost and 1and1.

3. The name. Pick one of course that is not already taken. domize is a great tool to search domain names and availability. One way to get inspired for a good name is to browse other blogs and see what name styles appeal to you. In my case, since my blog is in two languages I bought an extra domain for the translated name and set up a domain forwarding to the translated portion of the site.

4. The theme. If you’re ok with the default, kubrick, you’re technically good to go. Most people however want their own theme, including me. That’s where I got in trouble. You can create your own but it’s much easier to start from an existing theme and modify it. Don’t start with a complex design and then try to match an equally complex theme to it, like I did originally. Pick a basic theme and then work from there. I chose Infimum and gave it a whole new look by adjusting the content and sidebar widths, adding a graphic in the header, and changing font style and sizes.

5. The plugins. There are tons, you can waste a lot of time here. Some I picked are: Lightbox Plus for slideshows, Simple Tags for tags, del.i.cio.us for Wordpress to post my latest bookmarks, and WP-Gravatars to customize the look of the default gravatar. My flickr badge came from the Flickr site and I customized the layout by modifying the badge’s code.

6. The translation plugin. The idea behind this kind of plugin is to have one wordpress installation that can display content in more than one language instead of having to maintain separate blogs. I experimented with a couple plugins (Language Switcher and ZdMultiLang) then with the guidance of one or two helpful articles on multilingual blogging, I found the one that worked best for me: qTranslate.

Make sure you install the plugin version that matches your wordpress version. See the download area on the plugin site for a table of corresponding versions. Once installed, you can easily set which language you want to use for your blog in the plugin settings and it will automatically alter the wordpress admin interface for easy input in all languages. It also includes a widget for the language switcher on the blog sidebar.

You can test writing an entry in multiple languages to see if it will switch the text correctly.
If you see your post in the default language but you get a 404 error on the translation language, you need to change the URL modification mode to “Use Query Mode (?lang=en)” under advanced settings in the plugin settings page. Somehow the default setting does not work with all server configurations.

7. The theme translation. Many themes available on wordpress come translation ready. That means special tags were inserted for every bit of text displayed in the theme. That was not the case for the theme I selected, Infimum, so I had to do it myself. Translating a theme is quite a bit of work I’ll admit, but it’s worth it. I’m warning you though, you need to be comfortable with code. I’ll outline the basic steps here, but check this great how to guide for the full details:

  • go through every php file in your theme that contains displayed text and mark it for translation with GetText calls.
  • collect all the marked strings into one text file with extension .po (portable object). You can do that with this free online utility.
  • edit the .po file in a translations editor program like Poedit (free and available for Windows, Mac, and Linux). Translate all strings and save the file. This will generate a .mo file (machine object) that the computer can read.
  • upload the .po (optional) and .mo files to your theme’s directory
  • include one php command in your header php file so wordpress knows to use the translation

And voilà. In theory you go through this once, but honestly you’ll probably run through this loop a few times as you test your translated theme and decide to tweak the text here and there. Note, the same procedure goes for translating plugins.

8. The language tags. For things like blog title and tagline qTranslate provides convenient language tags you can use for translation. These language tags can also be used in other places like for the content in the text widget. The only place where they don’t work currently is in the widget titles. A workaround is to add the title translation directly in the php file of the widget. It’s not an ideal solution because when you upgrade you’ll have to re-enter your modifications, but it’s the least complicated solution I found. In wordpress, the php file for widgets is default-widgets.php, under wp-includes.

9. The end. If you’ve made it this far down this long post, you have the perseverance it takes to start not only a blog, but a multilingual blog. Here is good advice about writing good blog posts. Congratulations, you’re done and ready to go. Good luck!

Related Posts with Thumbnails

Say something.