
內容簡介
LocalMoney 是一個兼容快取的 WordPress 外掛,它可以將貼文或頁面中您選擇的貨幣的所有價格轉換為訪客當地貨幣。LocalMoney 依賴 WP-cron 系統每小時從 Open Exchange Rates 獲取並快取匯率,接著使用 JavaScript 查找訪客的位置並提取相應的匯率資料。這意味著,與某些其他外掛相比,LocalMoney 是與快取外掛兼容的。
LocalMoney 一旦配置完成,會立即(或在快取更新後)作用於您所有的貼文和頁面,而無需在文字中標註價格。
功能
透過 IP 地址確定讀者的國家,使用 IP2C
解析具有 "forwared-for" 標頭的代理,因此與 AOL 兼容
如 IP2C 失敗,使用語言設置和時區偏移量來猜測位置
從 openexchangerates.org 獲取匯率
使用 AJAX,以便轉換貨幣值不會延遲頁面加載時間
本地快取匯率以最小化呼叫 openexchangerates.org 時間
輸出與輸入價格格式匹配的價格(即帶或不帶分的價格)
使用方法
安裝 LocalMoney 後,它將接受任何其中列出美元價格的頁面,並將其轉換為訪客的當地貨幣。如果您的貼文使用的是另一種貨幣,您可以在"設定 > LocalMoney"中更改基礎貨幣。
國際化 (i18n)
目前 LocalMoney 還沒有被翻譯成英語以外的任何語言。
如果您希望,請隨時創建翻譯。以下是基本步驟:
將 "localmoney-en.po" 複製到 "localmoney-LANG_COUNTRY.po" - 以 wp-config.php 中使用的 WPLANG 為 LANG 和 COUNTRY。
獲取翻譯編輯器。我們使用的是 POedit。
翻譯每一行。
將新的 localmoney-LANG_COUNTRY.po 文件發送至 [email protected]。
您的翻譯將納入下一個版本中。
外掛標籤
開發者團隊
原文外掛簡介
A cache-compatible WordPress plugin which converts all prices of the currency of
your choice in a post or page in the viewer’s local currency. LocalMoney relies
on the WP-cron system to fetch and cache the rates from
Open Exchange Rates
on an hourly basis and then uses javascript to lookup the visitor’s location and
fetch the appropriate rate data. This means that, unlike some plugins I could mention,
LocalMoney is compatible with caching plugins.
LocalMoney, once configured, immediately (or as soon as your cache updates) acts
on all your posts and pages without you having to mark up the prices in your text.
Features
Determines the reader’s country via IP address, using IP2C
Resolves proxies with the ‘forwarded-for’ header so AOL-compatible
If IP2C fails uses the language settings and timezone offset to guess location
Obtains exchange rates from openexchangerates.org
Uses AJAX so that converting currency values doesn’t delay page load times
Caches exchange rates locally to minimize calls to openexchangerates.org
Output prices matched to format of input prices (i.e. with or without cents)
How to Use
Once LocalMoney is installed it will take any page on which US dollar prices are
displayed and convert them to the visitors local currency. If your posts are written
with another currency you can change the base currency in the Settings > LocalMoney
page.
Internationalization (i18n)
Currently LocalMoney has not been translated to any languages other than English.
If you wish, feel free to create a translation. Here are the basic steps:
Copy “localmoney-en.po” to “localmoney-LANG_COUNTRY.po” – fill in LANG and COUNTRY with whatever you use for WPLANG in wp-config.php.
Grab a transalation editor. POedit works for us.
Translate each line.
Send your new localmoney-LANG_COUNTRY.po file to [email protected].
Your translation will be incorporated in the next release.
