<language> Element in RSS 2.0 Specification

<language> element in a RSS Feed specifies the language that this feed is written in. WordPress prints the value of `rss_language` option.

This can be consider as a bug in WordPress – there is no option in admin page to change the value, you have to change it by yourself from the database. This affects everyone who blog using WordPress and blog in non-English lanugage.

Another problem of mine: What should I do to express the fact that the feed of my blog is written in both Chinese and English? RSS Spec doesn’t allow <language>en,zh-tw</language> expression (invaild ISO country code) nor the <language>en</language><language>zh-tw</language> (cannot be used twice).

Maybe I just … can’t. In this moment, I think I should edit wp-include/wp-rss2.php to read value from polyglot.

Before WordPress fix the bug, everyone should change their `rss_language` value in `options` table to stop your feed sending bad metadata.

RSS Feed裡面的<language>元素定義這個feed撰寫的(人類的)語言。WordPress會拿選項資料表裡的 `rss_language` 來顯示。

然後,這算是WordPress的一個bug —— 網站管理員裡面並沒有任何設定可以改這個資料;安裝的時候也沒有。所有 blog feed 送出來的語言定義都是 en ,除非您自己去資料庫修改。這個bug影響所有用WordPress寫blog的人

接著就是我的問題了:我要怎麼表達我的 feed 是用英文與中文兩種語言撰寫的?RSS標準格式不准許 <language>en,zh-tw</language> 寫法 (無效的 ISO 國家代號),也不准用 <language>en</language><language>zh-tw</language> (此元素不可使用兩次)。

說不定我根本就無法這樣定義。總之我應該會去改 wp-include/wp-rss2.php 讓它去讀 polyglot 的設定值吧。

在WordPress提供可以修改 `rss_language` 的選項之前,大家先趕快去資料庫的 `options` 資料表改吧。不然會一直送錯誤的資料出去喔(飄)。

Leave a Reply

Your email address will not be published. Required fields are marked *