[fr] Quelques réflexions concernant un plugin multilingue pour WordPress.
My blog has been bilingual for a long time now. I’ve hacked bilingualism into it and then plugged it in. Other plugins for multilingual bloggers have been written, and some unfortunately got stuck somewhere in the development limbo.
Defining specs is a hairy problem. They need to work for the person visiting the site (polyglot or monoglot). They need to work for the person (or people! translation often involves more than one person) writing the posts. They need to work for all the robots, search engines, and fancy browsers who deal with the site.
Here is what I would like a multiple language plugin to do (think “feature requirements”, suggestion, draft):
- Recognize the browser language preference of the visitor and serve “page furniture” and navigation in the appropriate language. This can be overridden by a cookie-set preference when clicking on a “language link”.
- “WordPress” furniture can be provided by the normal localization files
- how do we deal with other furniture content in the theme (navigation, taglines, etc.)? should the plugin provide with guidelines for theme localization? do such guidelines already exist? extra information appreciated on this point
- “language links” shouldn’t be flags, but language names in their respective languages; can this list be generated automatically based on present localization files? otherwise, can it be set in an admin panel?
- upon “language change” (clicking on a language link), could the localization (action) be done in an AHAH– or AJAX-like way?
- inevitable hairy problem: tag and category localization
- Manage “lazy multilingualism” in the spirit of the Basic Bilingual plugin and “true multilingualism” elegantly and on a per-post basis.
- allow for “other language abstracts”
- allow for actual other language version of the post
- given the “general user language” defined above, show posts in that language if a version for that language exists, with mention of other language versions or abstracts
- if that language doesn’t exist, show post in “main blog language” or “main post language” (worst case scenario: the wordpress install default) and show alongside other language abstracts/versions
- abstract in one language (would be “excerpt” in the “main” language) and existence of the post in that language are not mutually exclusive, both can coexist
- does it make more sense to have one WordPress post per language version, or a single post with alternate language content in post_meta? For lazy multilingualism, it makes more sense to have a single WP post with meta content, but fore “translation multilingualism”, it would make more sense to have separate posts with language relationships between them clearly defined in post_meta
- Use good markup. See what Kevin wrote sometime back. Make it nice for both polyglot and monoglot visitors. Inspiration?
- use
<div lang="xx">
and also rel attributes
- use
- Provide a usable admin panel.
- when I’m writing the other version of a post, I need access to the initial version for translation or abstracting
- ideally, different language version should be editable on the same admin panel, even if they are (in the WordPress database) different posts
- languages in use in the blog should be defined in an options screen, and the plugin should use that information to adapt the writing and editing admin panels
- idea: radio button to choose post language; N other language excerpt/abstract fields with radio buttons next to them too; abstract radio buttons change dynamically when main post language is set; in addition to other language abstract fields, another field which can contain a post id/url (would have to see what the best solution is) to indicate “this is an equivalent post in another language” (equivalent can be anything from strict translation to similar content and ideas); this means that when WP displays the blog, it must make sure it’s not displaying a post in language B which has an equivalent in language A (language A being the visitor’s preferred language as defined above)
- Manage URLs logically (whatever that means).
- if one post in two languages means two posts in WP, they will each have their own slug; it could be nice, though, to be able to switch from one to an other by just adding the two-letter language code on the end of any URL; a bit of mod_rewrite magic should do it
- Integrate into the WordPress architecture in a way that will not break with each upgrade (use post-meta table to define language relationships between different posts, instead of modifying the posts table too much, for example.)
- one post translated into two other languages = 3 posts in the WP posts table
- excerpts and post relationships stored in post_meta
- language stored in post_meta
I have an idea for plugin development. Once the specs are drafted out correctly, how about a bunch of us pool a few $ each to make a donation to (or “pay”) the person who would develop it? Who would be willing to contribute to the pool? Who would be willing to develop such a plugin (and not abandon the project half-way) in these conditions?
These specs need to be refined. We should start from the markup/reader end and get that sorted out first. Then, think about the admin panel/writer end. Then worry about code architecture. How does that sound?
We’ve started a discussion over on the microformats.org wiki. Please join us!
Update: this post is going to suffer from ongoing editing as I refine and add ideas.
Hm. Interesting article.
So, for the moment, there is me and another person (patfm) willing to contribute to a pledge bank. Anybody else?
It’s nice to have found this post.
I run a site (WP based) which is going multilingual. After some research, I didn’t found any plugin which satisfied my requirements, so I thought I should swap the CMS.
I’ve been playing with Drupal (and its module “i18n”) and Joomla/Mambo (and its “Mambelfish” add-on). Although both systems are really powerful –much more than WP–, I feel much more comfortable using the WP admin interface.
Plus, none of the aforementioned add-ons works the way I like. So, now I’m taking the route of developing a new WP plugin.
Development has already started and at the moment I have a first (incomplete) version running at my development site.
Please feel free to contact me for more info (I’ll be watching this posts’ comments, too).
Hi,
I’ve written a plugin that does almost all of what you have here. The one thing it doesn’t do at the moment is change the page ‘furniture’. It does however use a good database structure, offer side-by-side translating and summaries and outputs semantic markup. It offers both your “Lazy” and “Full” translating. I’ve made the user-interface pretty straightforward too, I think (I hope). I’d be really interested in any feedback you could give, seeing as this is kind of the post everybody points to when they talk about a multi-lingual WordPress. I have a demo site up and running at:
http://jamietalbot.com/gengodemo/
If you’re interested, email me and I’ll set you up an account so you can see how it goes…