Multilingual content in WordPress, September 2010

Someone emailed me recently to ask about how they should approach the task of setting up a multi-lingual WordPress site (en+fr). My response was long enough that I figured I’d post it here for anyone curious about my thoughts.

We’re looking to update our WordPress website with a multi-language setup […] Would you recommend that we use a multi-lingual plugin, such as WPML, or just create two different wordpress sites?  I’d rather do the former, since once setup it demands much less updating.  I’ve heard in the past that this is very difficult to do, but now with WP 3.0, I’m thinking it must be much easier.  I’d much appreciate your opinion.

Multi-lingual in 3.0

The advent of 3.0 has changed many things but not the frustrating lack of support for multilingualism in WP. The same issues exist now as did in the 2.x days. The main relevant change in 3.0 is that WPMU, a seperate project which let you have multiple sites in one installation, is now part of the main WordPress code. The feature is now referred to as “Multi-site” or “Network” and is fairly easy to activate. This means if you decide to use separate sites it is a bit simpler to have both sites running off the same WP install and sharing themes/plugins. Just set up your main site as mysite.com and the French one as fr.mysite.com.

Plugins can be abandoned

While its true that two sites requires more tedious repetitive work during updates it less likely to involve insane compatibility work that could arise from the plugin acting up or becomming unsupported. Users of the previously-standard Gengo plugin all got fucked around version 2.5 (don’t feel like looking up the exact version) when the plugin stopped working and none of them could update their sites, leaving them susceptible to hackers. An unpatched version of WP is often vulnerable to attack and a site that depends on a plugin that stops working can’t be patched.

WPML.org is probably your best bet for a plugin

WPML seems like it has serious and dedicated professional developers, and has a LOT of features that are very useful, so its a decent bet that as a translation system it will continue working for a long time. Especially if you don’t have a ton of content it is a pretty good choice (because you can always copy/paste the content into a second site some day if the plugin stops working). Using it will require some heavy modifications to your theme if you want the language chooser etc. to actually make sense. My experience with WPML has lead me to believe that the devs aren’t particularly great UI designers compared to their programming skills.

Multiple sites keeps your posts database clean and logical

I personally like the two-site approach because it keeps your content and databases clean as a tradeoff for the deeper linkage between translations you could otherwise get from a plugin. It’s extra hassle to edit the content on both sites all the time but IMHO the bigger hassle is actually translating and keeping content fully synchronized which is nearly impossible regardless of your translation infrastructure.

On Global Voices we have a custom solution we call Lingua

I don’t have any real experience with WPML or qTranslate (the other big name in WP translation) because on Global Voices (the site I run) I’ve coded a custom translation plugin that we call Lingua. It uses separate sites but keeps a database that links translations across the sites (see http://fr.globalvoicesonline.org/2010/09/02/43270/ for an example of the output). IMHO this is the best model for running translations because if the plugin stops working all you lose is the links to other versions. Each translation site can continue to work independently without knowledge of the others, so you can work on the update issues seperately while still being secure. Unfortunately the plugin isn’t even close to being public-friendly, but I’m hoping the model gets used someday. I added it to the list of potential plugin types on the Codex page about multilingual WordPress.

Maybe one day it will be easy

Good luck to anyone trying to build multi-lingual WordPress sites. It’s a nightmare but none of the other CMS options are actually much easier, and all the other benefits of  WP make it hard to turn down. Here’s hoping that one day the core development team is willing to pick up the problem and commit to a standardized solution (vote for built-in multilingualism on the WordPress “Ideas forum”).

EDIT (Sep 11, 2010): I should also mention the Worldwide Lexicon project and their WWL translation plugin for WordPress. It has an intense approach that combines machine translation with human editing to make your site quickly translated and let you improve it incrementally as time goes on. I haven’t used their plugin myself because older dev versions I tried were very buggy and hard to understand. If you’re just starting now the new versions are worth a try and may be a good solution if the combination of machine and human translation is desirable to you.

WordPress Admin Header Redesign: Light or Dark?

WARNING: Intense discussion of the open-source design of the WordPress website software lies ahead. I will literally discuss shades of grey. People uninterested in WordPress and its future should probably learn more about snuggies instead.

I updated my WordPress SVN Trunk installation today and noticed a huge change to the admin screens that had just been committed. The header and footer of the admin section had been switched from basically black to a very light grey color. This change was committed as a work in progress, so people would see it and work towards a final solution.

Fig 1. Old admin header color on top, current SVN version below.

Old WordPress header color and temporary new on in SVN

Overall I support this change and think it looks better, but the exact shade of grey in the background didn’t match the gradients in similar UI elements (the dashboard sections and screen options buttons) so I worked out a different light-grey graphic to use as a background that would match. Here is a screenshot of how it should look if this light grey is used in the final WP 3.0 release, I think it is pretty solid and shouldn’t make anyone cry.

Fig 2. WP-Admin with darker but still light-grey heading and footer. Pretty okay.

Screenshot of wp admin with light grey header and footer
Click to view full size

I remembered a conversation on the WP UI dev blog where another middle-grey option was proposed but didn’t get a lot of attention. I really liked the darker grey version in JohnONolan‘s original mockup so I worked out a full page screenshot using the darker shade of grey that I thought worked better and added them to the trac ticket about the header change.

Here’s the one I think would work the best, dark grey to match the active heading in the sidebar (in this case the “Dashboard” section heading).

Fig 3. Nice dark WordPress Admin screen, how it should be.

Screenshot of my proposed WP admin colorsClick to view full size

Here is one giant image with both of them so you can compare. Instead of images like this I like to open two versions in seperate tabs in my browser than jump back and forth to decide which I prefer.

Fig 4. Side-by-Side comparison of light and dark grey proposals for admin header and footer.

Side by side comparison of light and dark optionsClick to view full size.

I’m hoping the dark one can get implemented because it has a lot of nice features that the lighter version lacks:

  • It is not a big change from the old version, so people will be inherently less upset about it.
  • It brackets the whole UI nicely and preserves the high-contrast from the old design.
  • It avoids a page where 90% of the chrome matches each other pefectly. I think the dark grey is important to keeping the look neat, and having only one element in the page with that color (the active sidebar heading) make it look unbalanced.

Feedback welcome, what do you think? If you want to support/flame me the trac ticket about it is probably the best place, so that your input affects the final decision.

Mac OSX: Setting a keyboard shortcut for maximize/resize window (green jewel)

I’ve been dreaming for a long time of a system-wide keyboard shortcut to maximize/resize the current window in OSX (windows-style, where the window fills the screen or not, rather than going to the dock). In pretty much every application the ‘Window’ menu item has Minimize (shunt to dock) and “Zoom” which resizes the window and has the same effect as the green “+” jewel in the window header. The Minimize item has the easy-to-use keyboard shortcut CMD+, while the Zoom item has no shortcut and no hint at how to get one.

EDIT (Sep 27, 2010): Based on my realizations about Firefox and NetBeans detailed below I now think this method is pretty insufficient for me and probably lots of other people. I have since tried the 13$ SizeUp application recommended by Martin Reisch in the comments. It is excellent and elegant and solves both the problems I had and ones I didn’t realize I had until they were solved. I recommend it whole-heartedly for those among us with big screens and small patience for window management.

divvy logo EDIT (Jan 24, 2012): Another commercial solution to this problem that has appeared is Divvy. I haven’t tried it yet simply because I have SizeUp working and already paid for it, but from what I’ve heard Divvy takes it to the next level by adding a slick graphical interface in addition to keyboard shortcuts, as well as letting you create infinite different resizes, whereas SizeUp limits you to preset ones. Divvy has a demo so you can try it for free.

I looked around and found some totally whacked out solutions involving applescript or bash scripting but finally found an incredibly simple and obvious method using System Prefs. I recommend it for everyone who is sick of using the mouse to hit the tiny green jewel.

Detailed steps to set a Maximize keyboard shortcut in Mac OSX 10.6

  • Launch System Preferences from the Apple menu
  • Go to Keyboard settings
  • Go to Keyboard Shortcuts tab at the top of the window.
  • Go to Application Shortcuts in the sidebar of the window.
  • Click the small + button
  • In the popup thing make sure ‘All Applications’ is selected for Application:
  • In the Menu Title box type in exactly: Zoom
  • In Keyboard Shortcut type in the shortcut. I recommend Command-Shift-M
  • Click Add button.
  • Restart each app you want it to work in.

Screenshot of the system prefs window where you set the keyboard shortcut

Note on restarting apps: These shortcuts work on an app-by-app basis so it will only work in a given application after the app is restarted. Thus if you restart your computer it will immediately work in all apps.

Note on choosing a shortcut: I chose Command+Shift+M (Command is the ‘apple key’) because it matches the Command+M keyboard shortcut for Minimize/send-to-dock and will be easy for me to remember. You can set it to another combination if you want, but think carefully as you don’t want it to be something that any other applications use or you might have strange results.

EDIT: Well don’t I look stupid. It turns out this keyboard shortcut doesn’t work with Firefox, the application I spend most of my time in! I thought it wasn’t working cause it needed to be restarted but that didn’t fix it either. The problem is that Firefox has its own menu item called “Zoom”, under the View menu, which doesn’t do anything but holds the page zooming functions inside it. For whatever reason this means that the configuration described above activates that menu item and stops the Window > Zoom menu item from working. GAH! I might have to try the app mentioned in the comments to find true happiness.

The GoldenPalace.com Monkey

The GoldenPalace.com Monkey (Wikipedia Link), was discovered in Bolivia and named by auctioning off the decision to the highest bidder. The proceeds went to the national park where the monkey was discovered.

goldenpalacemonkey

Pointed out by Eddie Avila as both the worst and best thing about Bolivia.

I would have called it George Bush.

Montreal WordPress Developer Meetup this thursday

So yeah, as the title of the last post (which has slowly become ludicrously out of date) implies, WordCamp Montreal was in fact pretty awesome. If you’re a visual kind of person check out the photos.

wordpres-montreal-community-logo-square-400Now a few months have passed since then and its time to move on. Move on to something other than WordPress events? No. Move on to smaller, more regular, less stressful WordPress events (and hopefully some posts here on my blog about other topics, we can still dream).

We’re going to use the Montreal WordPress Community group on facebook to organize evening meetups about once a month (join the group to get invited automatically). Patrick and the members of Station C have generously offered to let us use their coworking space for our get-togethers. This is great cause its sexy and well stocked with tools, but sad cause its not that big. Hopefully we can keep a healthy level of attendance without exploding.

The first meeting will be this thursday, when we’ll have a presentation and discussion about programming tools and how they can speed you up followed by a discussion of GPL and what it means for paid themes, plugins etc. I also told people to bring drinks and food, so it should be a cool party as well. You can read more about it and RSVP on the facebook event listing.

WordCamp Montreal will be awesome

I'm Speaking at WordCamp Montreal - Jul 11-12I’ve been spending a lot of time lately getting shit ready for WordCamp Montreal, Montreal’s instance of the user-generated WordPress conference that has already happened in cities literally across the entire planet (I’ve been to New York, San Francisco and Toronto in the past).

Today the tickets went on sale (25-30$) which is a huge relief. There’s still lots of work to do organizing the speakers/schedule, sponsors and all the other details, but we’re on our way to a really useful and fun event if I have anything to say about it.

I’ll be doing a talk about whatever is missing from the lineup of speakers who come forward, which reminds me: Would you like to become a speaker? We’re still looking for WP experts to share their wisdom and experience and hopefully some laughs, so get in touch if you think that might be you. Oh yeah, if you’ve got a pile of money and have been hoping for some visibility maybe you’d like to sponsor WordCamp Montreal? It’s the perfect way to make yourself known to an incredibly useful new subsection of the north american technocracy!

My vote for GV Advocacy

Zemanta, a Firefox extension that automatically suggests related tags, links, photos and articles for your blog posts and e-mails, is running a competition to encourage blogging for worthwhile causes. The five blogs that get the most votes will each win $3,000.

Global Voices Advocacy - Defending free speech online I vote for Global Voices Advocacy, the anti-censorship (and anti-blogger-imprisonment and pro-internet-awesomeness) wing of Global Voices. GV Advocacy is something made of pure good, a blog about bloggers getting shafted in countries where freedom of speech isn’t a cliche, its a dream that people can only hope for. Sami, our editorial lead for the project, is himself the victim of censorship in Tunisia, and his dedication to the project and the cause is astounding.

Obviously I’m biased as far as this contest goes, my paycheck comes from Global Voices and this money would be going into that pool, but I work for GV because I believe in it, so this post is my biased but sincere vote for my employers to get the funding and recognition they deserve (if only my coding/design was as good as the content our authors and editors produce…)

This blog post is part of Zemanta’s “Blogging For a Cause” campaign to raise awareness and funds for worthy causes that bloggers care about.

Simianuprising.com now hopefully UN-hacked.

So this site was ironically hacked and hijacked by blackhat SEO spammers who inserted a ton of bullshit viagra/homeloan/sex links into my theme in the hopes that it would illegitimately raise their ranking in Google. Of course that’s not inherently ironic, what’s ironic is that it happened while I was at WordCamp Toronto, a mini-conference about all things WordPress, where I gave a talk that included a long section about how to avoid and deal with being hacked in just this way for just these reasons. Some part of me thinks that someone at WordCamp might have done it to show me who’s boss, but I doubt it, the pattern of spam links is just to depressing and business-like to assume anything but an impersonal bot did the damage.

This has happened to other sites I’ve been managing (specifically to Global Voices over the years, and I’ve learned a lot about hardening your server and WordPress installation to help solve the problem. The #1 piece of advice is of course KEEP YOUR WORDPRESS INSTALLATION UP TO DATE, NO MATTER WHAT. In the case of this my personal site (as opposed to sites I manage professionally, which I deal with much more carefully, because they are more important) I was doing a halfway version of this by keeping my very old but theoretically still secure copy of WP 2.0.x up to date. This is the legacy branch (current actual branch is 2.7.x) that was supposed to offer long-term security support, but it seems that is no longer the case. I loved having the bragging rights of being the only person in a room with even 100 WordPress users who had such an old but still secure version (well, except David Peralty), but obviously staying secure is much more important.

If you’re still running 2.0.11 I strongly recommend you give up and get on the normal upgrade schedule now, it seems to have been compromised.

Full details of how to clean up a hacked site below:

Continue reading “Simianuprising.com now hopefully UN-hacked.”