Today’s focus has been mostly on bbPress, the discussion forum cousin of WordPress. I’ve played with it a few times in the past, but never yet had cause to use it properly or professionally. But when a call came from a client last week, asking to forum up an existing WordPress-based site, I ignored the advice of Tom Loosemore and set to work. Not feeling brave enough to use the v1.0 release candidate, I downloaded the latest stable v0.9.x version, and had it up and running in next to no time.
As it’s my first time building a bbPress theme, I’ve restricted myself almost entirely to CSS, and letting bbPress fall back on the default PHP code templates. As with WordPress, if your theme doesn’t include a file for a particular purpose, bbPress uses the equivalent from the default theme (‘kakumei’). But if you do that, you’re reliant on the peculiarities coded into those default templates… including, as it turned out, their Americanised spelling.
Unlike many forum apps, bbPress doesn’t have many bells and whistles – overall, that’s a good thing in my book. But one of the few extras it does offer is the ability to mark certain discussions as a ‘favorite’. You can view these as a ‘personalised homepage’, or follow their updates with a unified RSS feed. Fantastic, except if you’re building a site for a UK audience – who would much rather save some favourites. So for a while this morning, I found myself unexpectedly creating a new language pack for bbPress. This consisted of:
- Downloading a .pot file from Automattic.com’s servers. This is effectively a big list of all the individual system messages used by the software (in the default US English).
- Installing the open-source poEdit for Windows, which shows you all these messages in a big list, and asks you to enter equivalents in the foreign language of your choice (in our case, ‘en-gb’) alongside. I ran a search for ‘favorite’ and changed all matching messages to use the proper spelling. 😉 Watch out for phrases with more than one use of the word.
- When you save your amendments, you’ll end up with a file called en-gb.mo. If you’ve only changed the references to ‘favorite’, it’ll only be 2 or 3 Kb in size. You’ll need to create a languages folder within the bb-includes folder of your bbPress installation, and put the .mo file in it.
- Then you’ll need to edit the bb-config.php file at the root level of your bbPress installation. Look for a line that says define(‘BB_LANG’, ”); and add en-gb in between the second pair of quotes.
- And that should do it. When WordPress tries to produce a page based on the default templates, it will scan through your en-gb translations list, and in the few cases where it finds a match, it’ll replace the Americanized default with your Queen’s English alternative.
This reminds me of an idea I had a while back, to produce a ‘corporate English’ language pack for WordPress, replacing blogger jargon with text which might be more familiar to press officers, marketing people, journalists, or whoever. It might still be worth doing; although in the meantime, the word ‘blog’ seems to have lost its overwhelmingly negative connotations.