Sunday, November 9, 2008

Inpage Translation by Javascript

Let's say u are a regular blogger who happens to know quite a number of languages, you have the chance to reach out to many more people, compared to another guy who happens to know just one language. Yet you are short of $$, meaning u can only use free blogs that don't support writing multi-language contents, and u hate the idea of writing multiple posts for the same idea ... here's a simple solution to give u a helping hand - inpage_translator.js !!
或许你是个爱写博客的家伙,而你通晓好多不同的语言,相比较一个只懂得一个语言的家伙,你有机会让更多的人能够分享你的想法。可是,你的口袋有点紧,你只有免费的博客帐号,而往往这些帐号都无法支持不同语言的内容,而你无法想象为了同一个想法而写好多不同的文章,怎么办呢?或许有个好办法 - inpage_translator.js

Using it is damn easy, in fact, this post is already supported by inpage_translator.js. The concept is very simple, for each content under a different language, simply rewrite it as:
使用‘inpage_translator.js’是非常的简单的,你只需把你的博客内容写成:

<div class="lang-en">this is some english content</div>
<div class="lang-zh">这是中文内容</div>

And base on ur reader's browser language, inpage_translator.js will figure out which content to show, which one to hide. And for cases where it cannot figure out (eg. for 'fr'), it will display the default content (by default, it will be 'en') .. cool ?!
根据读者的浏览器的语言设置,‘inpage_translator.js‘能够推算出那些内容该被显示,或隐藏。而在它无法正确推算的情况下,它会显示默认的语言(’en‘,即英文)。。。不错吧?!

To find out more, goto:
想了解更多?请到:
http://github.com/ngty/inpage_translator.js

No comments: