內容簡介
這個 WordPress 外掛新增了一個 meta box,讓您可以在每篇文章裡指定 HTML lang 屬性的語言。
此外掛解決的問題
WordPress 允許我們指定全站的語言默認值,如下所示:
<meta http-equiv="content-language" content="es">
當您有多種語言的部落格文章時,會出現以下問題。個人而言,我會用英文或挪威語寫文章,但因為全站的語言設定為英文,所以挪威語的文章中會出現奇怪放置的連字符。
解決方案
解決方案是在需要時新增更具體的 HTML lang 屬性。
<article id="" class="" lang="vi">
例如,這會指定該篇文章是越南語。此外掛會在編輯文章時啟用一個 meta box,讓您可以指定文章的語言。
貢獻
這個外掛是很快做出來的,但請隨時建議改進。例如,此外掛缺乏測試代碼。
授權
版權所有 2014 年 Nils Norman Haukås
本程式是自由軟體;您可以重新散發它或修改它
根據 GNU 通用公眾授權條款第 2 版或(您選擇的)任何後續版本,
這是經由自由軟體基金會所發表的。
本程式分發是希望它有用,
但不提供任何保證;甚至沒有暗示保證適合特定用途,
詳細訊息請參閱 GNU 通用公眾授權條款。
您應該已經收到了 GNU 通用公眾授權條款的副本,
如果沒有,請寫信給自由軟體基金會,地址: 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 美國
外掛標籤
開發者團隊
② 後台搜尋「Set HTML lang attribute per post」→ 直接安裝(推薦)
原文外掛簡介
This wordpress plugin adds a meta box for specifying html lang=”” language per post.
The problem this plugin solves
WordPress allows us to specify site-wide language defaults like so:
The problem comes about if you have blog posts in various languages. Personally I write posts in either English or Norwegian. And since English is set as the site-wide language posts that are in Norwegian end up looking kinda weird due to weirdly placed - (hyphenations).
Solution
The solution is to add more specific html lang attributes when needed.
For example this specifies that the post is in Vietnamese. This plugin enables a meta box when editing posts where you may specify the post’s language.
Contributing
This plugin was made in a jiffy. But by all means do suggest improvements. For instance the plugin obviously lacks testing code.
Licensing
Copyright 2014 Nils Norman Haukås
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
