I18n in WordPress

A few months ago – when I wasn’t as familiar with WordPress as today – I downloaded a WordPress Plugin that promised to equip single pages and posts with custom header images. I noticed, that all options in the admin area were in English, and since I set up the plugin for a friend’s website, I wanted to top off my favor by translating the English descriptions, so he wouldn’t have a hard time with them. Unfortunately the plugin was developed by an ignorant shortsighted American, so I had to put all hardcoded strings into WordPress’ translation functions myself – and translate it. A few days later (and I am not making this up) he published an update with a few minor changes and – silly me – I updated it, overwriting all alterations I worked so hard on!

My plea to all plugin and theme authors: Internationalize! It makes your plugin/theme so much more attractive for users. You don’t even have to translate it yourself. Just set it up in a way, that people can work with it – in their own languages.

In the following days, I digged deep into the possibilities of internationalization in WordPress and I would like to quickly introduce the most important functions:

PHP Namespaces: A Tool For WordPress Plugin Authors?

PHP namespaces
As part of PHP 5.3, namespaces will be a tremendous improvement for framework developers and object oriented programmers. But also for some WordPress plugin authors, namespaces might be a neat instument to easily write non conflictable code.  So instead of having to be creative in naming classes, functions and constants, authors now just have to pick a unique plugin name (as always), declare a namespace for it and can feel free to use whatever function names they like and suits best.

Sounds tempting? There’s just one minor catch to it: Authors can’t assume that the average WordPress user has PHP 5.3 up an running on their system.

WordPress Sitemap Without A Plugin

WordPress sitemap without a plugin

When it comes to sitemaps, there is a variety of solutions with a ton of features and options out there for grabs. But anyone following my entries will have noticed, that I rather add a couple of lines of code to my functions.php than using another plugin. So I tried to create a simple way to implement a sitemap in my blog. Here is what I came up with: