Multilingual WP – making multilingual WordPress easy
Do you use/Have you used qTranslate in order to make your WordPress site available in multiple languages? If you do, then I guess you’ve experienced the breakages that occurred a couple of times in the last year – the reason is that the developer simply doesn’t have enough time to fix those issues on time. I’m not blaming him for that – as a developer myself I do understand that sometimes it’s hard to find spare time to go out with your friends, let alone to fix issues in a free open-source project.
I – just like you use qTranslate(well, to be honest I even used it in most of my work projects ) and I tried multiple times to make patches for the plugin in order to get it to work with the latest version of WordPress. But the problem is that the plugin itself has been designed pretty poorly and improving it/fixing it would take quite a lot of time – actually the author himself had the idea of completely rewriting the plugin, but he never got to that point.
So, I decided to write my own plugin, that would only use/or extend/ built-in WordPress functionality in order to provide multilingual support. The reason for this is that it will make maintaining the plugin a whole lot easier and much more compatible with future versions of WordPress.
How does it work
Here’s a quick overview on how the plugin works:
- You select which post types(posts, pages, custom post types) you want to make multilingual
- You select the languages that you want to have enabled(you’ll probably have to create them first though)
- You run the automatic post updater that creates a new post for every language that you enable(yes, including the default language)
- So if you have 3 posts and 2 languages enabled, you will end-up with a total of 9 posts in your database(you will still only see 3 in your admin page though). I decided to make an additional post for the default language in order to make changing the default language more hassle-free.
- You’re not obligated to run the updater, but unless you go to the edit screen for each post, the translation posts will not be created.
- The original post has a one-to-many connection with all of the translation post via a custom post meta called _mlwp_langs
- Each translation post has a one-to-one connection with the original post via a custom post meta called _mlwp_rel_post
- On the edit screen a button for each language is added above the title/content sections:
This ensures the best(in my opinion) compatibility with WordPress and other plugins, because:
- It uses a built-in WordPress function
- Because of the above doesn’t require any hack-arounds in order to get/set the content
- Because every translation is a separate post, you get different slugs for each language – out of the box This is done by adding a bunch of rewrite rules to the ones generated by WordPress. Yet another possible performance issue with bigger sites.
- Because all of the posts are edited from one screen, you don’t get different custom meta for every translation – instead any custom fields that you might have are connected to the original post – you can still use quicktags or translation shortcodes in order to translate your content.
For the latest information about the plugin and downloading the source code, please visit the page on GitHub