xLanguage (Wordpress Plugin)
Monday, January 21st, 2008
Contents
A WordPress plugin that allows you to blog in multi-language, and users to select which to read. If your want to localize and present your blog in different languages (totally with title, rss, categories working, not just the post) and allows visitors to pick the language they want, this plugin is for you.
xLanguage allows you to blog in different language, and allows user to select which version to read. It works for blog post, page, tags, categories. The user language preferences will also select the right theme and plugins MO files.
Customization is the No. 1 design goal, after all that’s probably the reason why you want to setup a multilingual blog. The language configuration combination is highly customizable to facilitate multiple fallbacks. Every UI is extracted out, which could be optionally overridden by theme design without touching the plugin file at all.
This plugin works by inserting W3C standardized <span lang=”..”> tag in the post content, and a XML parser will be involved to extract them when served, extracting all elements with the matching lang=”..” tag. The permalinks and RSS feeds are also presented correctly. For single line data such as post title, a special but simple syntax is introduced.
The language preference is detected from browser’s preferences, as well as from Cookie if user visited before. Widget and template functions are also provided to allow user to switch the language easily.
Please read on for the installation, complete usage guide, screenshots, comparisons and known problems. If you found this plugin useful, please consider supporting it.
Please feel free to let me know if you need additional template functions, or if you have any idea that could make this a even better plugins for you.
Notice
If you hit the following error message after installation:
can not redeclare class xLanugagePlugin on line 996 in xlanguage.php
Resetting the xLanguage configuration would help. To do that, please go to “Settings -> xLanguage -> Options” in the Admin control panel, Scroll to the very bottom and reset it.
This is a known problem but I can never reproduce this so have no idea how to fix it. Any volunteer in helping me is very welcome!
Change Log
v2.0.4 (r124177)
- A better handling logic about the parser log file failover.
- Updated robot list - code merged from the WassUp 1.7.1
- No need to upgrade if your installation has been working perfectly, although upgrading might bring SEO benefits as the search engine list has been updated.
v2.0.3 (r105104)
- A bug that causing infinity redirection loop is fixed (#23)
No need to upgrade if your installation is working perfectly. If you gave a try before and found that the URL generated does not work or causing infinity loop, please give another try with this.
v2.0.2 (r92141)
- Critical bug fixed: The SQL in get_pages_in_current_lang() is invalid (#22)
Please upgrade if your theme used get_pages() function.
v2.0.1 (r84024)
- New features: Now you can hide those post written in foreign that reader can’t read. See the updated user guide in the next few pages.
- Now it’s easier to put the flag icons! See the updated user guide in the next few pages.
- Support Wordpress 2.7.0
v1.3.3 (r44242)
- #9 is regressed causing xLanguage installation dead on arrival. Now fixed together with #10.
- This new version should solve the v1.3.2 installation problem.
v1.3.2 (r44032)
- #9 is fixed - xLanguage should be usable in WP-MU now.
v1.3.1(r43326)
- #8 is fixed - The static homepage bug introduced in v1.3.0.
v1.3.0 (r42456)
- New feature #4 is implemented. In addition, to http://example.com/page/something/lang/en, now it could be http://example.com/lang/en/page/something.
- No other bug is fixed.
Licensing
This plugin by Sam Wong is licensed under the CC-GNU GPL.

































































English
July 2nd, 2009 at 21:18
again, nevermind, i found it. Thanks for this plugin.
July 2nd, 2009 at 16:55
Hi! I read again this tutorial and I got it finally I transferred the code to the header. How about the css? I want to change how it looks to match my menu. I want it just texts line up side by side not blocks. Thanks
July 2nd, 2009 at 3:18
This is very helpful, thank you! You’ve made it very easy and simple to follow!
July 2nd, 2009 at 0:15
Hi, I like this plugin. I want to add it in the header.php not in widgets, how can i do that? thanks
June 24th, 2009 at 18:00
[...] I have been pondering many approaches for making Mortfiles Evolved available in both Swedish and English and so far I have looked at using a Wordpress MU setup, using the translation service like I have here on this website, getting creative with custom fields and finally using something like WPML or xLanguage. [...]
June 23rd, 2009 at 22:15
I think I meet the “Header Problem” too, all the pages works fine in switching languages except home page, when I switch there is 404 error . But my another Site works perfectly.
June 22nd, 2009 at 2:17
Я конечно, прошу прощения, но не могли бы Вы расписать немного подробнее.
June 21st, 2009 at 22:48
No other site I found was as helpful as yours has been to me!