[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?
<div lang="xx">and also rel attributes
- 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.