[WordPress] 外掛分享: Add Locale Class

前言介紹

  • 這款 WordPress 外掛「Add Locale Class」是 2017-08-13 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2023-11-07,距離現在已有 544 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.8 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

alanp57 | maxfoundry |

外掛標籤

language class | CSS language class | render CSS acording to language setting |

內容簡介

在多語言網站上,您可能希望根據當前使用的語言來渲染 CSS。Add Local Class 外掛通過在正面和管理頁面的 body 標記中添加當前語言代碼作為類別來解決此問題。

例如,如果您將網站的語言設置為法語,那麼所使用的語言代碼為 fr_FR。Add Local Class 會檢索語言代碼,將其格式化為"locale-fr-fr",並將其添加到網站前端的 body 標記中。它還會檢索後端用戶的語言代碼,並在網站後端將其設置為 body 標記類別。如果網站的語言更改為美式英語,那麼類別會更改為"locale-en-us"。

您可以在 CSS 文件中為法語和英語編寫不同的規則:

. locale-fr-fr .button {
背景顏色:藍色;
}

. locale-en-us .button {
背景顏色:紅色;
}

使用 Add Local Class 外掛,您可以在網站上使用特定於語言的 CSS。

此外掛沒有設置頁面。您只需安裝並啟用即可。

Add Local Class 外掛由 Max Foundry 提供。我們製作了一個 WordPress 資訊圖庫外掛、一個針對 WordPress 媒體庫文件夾的外掛和 MaxButtons。

原文外掛簡介

On multi language sites there may be occasions when you want to render CSS according to the current language in use. The Add Local Class plugin solves this problem by adding the current language code as a class in the body tag on both front end and admin pages.
For example, if you set the language of the site to French, then the language code used is fr_FR. Add Local Class will retrieve the language code format it as ‘locale-fr-fr’ and add it to the body tags on the front end of the site. It will also retrieve the language code of the backend user and set it as a body tag class on the back end of the site. Should the site’s language be changed to U.S. English, then the class would be changed to ‘locale-en-us’.
In your CSS file you can have one rule for French and another for English:
. locale-fr-fr .button {
background-color: blue;
}
. locale-en-us .button {
background-color: red;
}
With the Add Local Class plugin it possible to make use of language specific CSS on your site.
This plugin does not have a settings page. You simple install and activate it.
The Add Local Class plugin is brought to you by Max Foundry. We make a WordPress Gallery plugin, a plugin for WordPress media library folders and MaxButtons.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Add Locale Class」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.0 | 1.0.1 | 1.0.2 | 1.0.3 | 1.0.4 | 1.0.5 | trunk |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon