無賴騎駿馬肆意翔遊天際

语言切换 // Switch of Language

刚弄了一点点的小修改,就是加了一个小切换的link在旁边。当你开启一个单独的post然后该post拥有双语的话,那么你就可以在右手边的一堆额外资料找到一个切换语言的link。点击它,你就会看到这个post的内容将会全部变成英文。其实也没什么大不了的东西,只是为了这个加入了隐藏/显示切换罢了。我并没有因为这样儿去安装插件,所以不要问我这个功能从哪里来,只需要很简单的javascript罢了。


if (document.getElementById('postTextEnglish') != null && document.getElementById('postTextMandarin') != null)
{
document.getElementById('postMetaSwitchLang').style.display = "block";
}
else
{
document.getElementById('postMetaSwitchLang').style.display = "none";
}

如我所说,我是用了很简单的方式去处理这件麻烦事情,从上面的程序片断就略知一二。我想上面的片断简单的不需要我在做任何解释了吧?

为什么我要去弄一个这样的东西出来,原因是从过去的post看得到,中文的部分,看起来已经相当多了,加上英文的内容简直就是完全长到不行,为了美观,我把英文的内容先行隐藏(我这个blog主要还是中文的)。这个目前应该算是临时的方案吧,或许下一次的界面更新会有一个更为成熟的方式去处理这样棘手的问题。看来这次的界面更新将会和之前一样,在运作的过程中一直有新的想法要加进来。是好事还是坏事呢?

I just made a small modification to this blog, i.e. I added a link for language switching at the right of the post in the individual post page. The link will be visible when there is a post (not posts prior to today) with both English and Mandarin content inside. I didn’t purposely install a plugin to do that but instead implement this using a simple javascript, so don’t ever bother to ask me what plugin I installed.


if (document.getElementById('postTextEnglish') != null && document.getElementById('postTextMandarin') != null)
{
document.getElementById('postMetaSwitchLang').style.display = "block";
}
else
{
document.getElementById('postMetaSwitchLang').style.display = "none";
}

As mentioned above, I chose the easiest solution as you see above. Just lines of code used, those code should be clear and simple enough to understand w/out any description.

The reason behind why I do this is because my posts in Mandarin is already quite lengthy (yes, I am grumpy), it is even worse when I have to mix it with English posts. Therefore, to make sure everything is tidy and nice, I hid this English section of post on load (this is more to a chinese blog anyway). This will be the temporary solution for the problem and hopefully I will be able to solve this problem better in the next update to the interface. 😀

Related Posts Plugin for WordPress, Blogger...

leave your comment

name is required

email is required

have a blog?

This blog uses scripts to assist and automate comment moderation, and the author of this blog post does not hold responsibility in the content of posted comments. Please note that activities such as flaming, ungrounded accusations as well as spamming will not be entertained.

Comments

不谢
是应该的
搞到你们蒙喳喳真不好意素

author
Jeffrey04
date
2006-10-15
time
16:21:36

好的,知道了。谢谢通知

author
妮子
date
2006-10-15
time
16:17:49

没有很复杂,你看看右边的一大堆link
第一项是一个切换语言的link
按一下就可以切换语言
如果该post没有双语,就没有哪个link

author
Jeffrey04
date
2006-10-15
time
11:46:01

双喜姐,你的英文怎么可能滥呢?以前还有一个英文的部落格,真是让人叹为观止。老公还是受英文教育的涅。

我的英文讲也不行写也不行(这里讲这里算,我过后找工也是要硬硬充成很行的,哈)。
写报告时就找很多份之前的报告,这里挪一句那里抽一句,不然就模仿那种句子,最重要能够表达自己的point就可以了。这种技术性英文的就还可以啦。

author
建杰
date
2006-10-15
time
04:00:27

好复杂,需要一点时间消化。

如果建杰的英文算‘滥’的话,那我的不是算‘滥’到淹鼻子了(淹死了)?

author
双喜姐
date
2006-10-15
time
01:52:46

生意,很有趣的形容

author
Jeffrey04
date
2006-10-14
time
16:32:00

啊哈 😆
生意好象越做越大了。

以前我的部落格还想做双语的,结果英文实在太滥了,就变成全中文的了。

author
建杰
date
2006-10-14
time
16:30:35
Click to change color scheme