[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](http://climbtothestars.org/archives/2004/07/11/multilingual-weblog/) and then [plugged it in](http://climbtothestars.org/archives/2005/01/23/basic-bilingual-plugin/). Other [plugins for multilingual bloggers](http://codex.wordpress.org/Plugins/Translation_and_Languages) have been written, and some unfortunately [got stuck somewhere in the development limbo](http://doocy.net/archives/2005/01/20/the-multilingual-acknowledgement/).
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):
1. 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](http://microformats.org/wiki/rest/ahah)- or [AJAX](http://en.wikipedia.org/wiki/AJAX)-like way?
– inevitable hairy problem: tag and category localization
2. Manage “lazy multilingualism” in the spirit of the [Basic Bilingual plugin](http://climbtothestars.org/archives/2005/01/23/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
3. Use good markup. See [what Kevin wrote sometime back](http://epeus.blogspot.com/2005_01_01_epeus_archive.html#110513233021128637). Make it nice for both polyglot and monoglot visitors. [Inspiration?](http://blogamundo.net/dev/2005/10/31/a-nice-language-switching-widget/)
<div lang="xx"> and also rel attributes
4. 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)
5. 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
6. 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](http://microformats.org/wiki/multilingual-brainstorming). Please join us!
Update: this post is going to suffer from ongoing editing as I refine and add ideas.
- Plans for Basic Bilingual [en] (2010)
- Multilingual [en] (2007)
- Basic Bilingual 0.3 for Multilingual Blogging [en] (2007)
- Bunny's Print CSS Plugin Upgrade [en] (2008)
- Bunny's Language Linker: New WordPress Plugin [en] (2007)
- WPML to Make Your WordPress Site Multilingual [en] (2009)
- Basic Bilingual 1.0 Plugin for WordPress: Blog in More Than One Language! [en] (2013)
- Basic Bilingual Plugin [en] (2005)
- BlogCamp: Multilingual Blogging Session [en] (2007)
- BlogTalk 2008 Proposal — Being Multilingual: Blogging in More Than One Language [en] (2007)