[WordPress] 外掛分享: flexo-language

首頁外掛目錄 › flexo-language
全新外掛
安裝啟用
尚無評分
5232 天前
最後更新
問題解決
WordPress 3.0.5+ v1.0001 上架:2011-11-21

內容簡介

這個外掛讓使用者可以翻譯靜態文字,例如:
echo _l(‘cat’);

詳情請參閱 http://www.flexostudio.com/

使用方式

需要創建一個位於 WordPress 主題內部的 php 檔案,檔案名必須是 lang_ (將翻譯的語言種類加在後面,例如 lang_en.php)
該檔案需要包含以下程式碼:

<?php $FL_DICT = array(

'cat' => 'Katze',
'dog' => 'Hund',
.............

);?>
其中的 'cat' => 'Katze' 是一個單詞及其翻譯的對應。

在 function.php 中新增以下程式碼:
<?php if(class_exists(‘flexoLanguage’)){

$f = dirname(__FILE__);

if(!flexoLanguage::is_set_language())
flexoLanguage::set_language('en');//選擇語言

flexoLanguage::add_dictionary($f);

function _l($key){
return flexoLanguage::_($key);
}

}
否則,新增以下程式碼讓單詞不被翻譯:
function _l($key){return $key;}

並且在任何您想擁有另一種語言翻譯的單詞出現的程式碼中,加上以下語句:
_l(‘cat’);

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0001) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「flexo-language」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

It allow the user to translate static texts as the example:
echo _l(‘cat’);
see http://www.flexostudio.com/
How to use
need to make php file that is located inside the theme, it must be said lang_ (languages ??which will translate as lang_en.php)
and contains the following code:
'Katze',
'dog' => 'Hund',
.............

);?>
where ‘cat’ => ‘Katze’ ‘regulations is a word and its translation.
in function.php to add the code:

and everywhere in the code where you write words you want to have a translation in another language and place:
_l(‘cat’);

延伸相關外掛

文章
Filter
Apply Filters
Mastodon