POTCreator – Gettext POT文件生成器
概要 / Summary
这是一个用于生成 GETTEXT 的 POT 文件的类,然后你就可以使用 Poedit 进行翻译啦。 – This class can help you to create a POT file for GETTEXT, Then you can translate it by Poedit.
网上找了很久,都没有找到这样的工具,于是乎自己写了一个,大家使用过程中有问题,可以在此回复。 – Please report bug here, thank you!
主页 / Home:http://hpyer.cn/codes/potcreator
用法 / Usage
// 包含类库 - Include the class
include('POTCreator.php');
// 创建对象 - Create object
$obj = new POTCreator;
// 设置参数 - Set parameter
$obj->set_root(dirname(__FILE__) . '/example');
$obj->set_exts('php|tpl');
$obj->set_regular('/_[_|e]\([\"|\']([^\"|\']+)[\"|\']\)/i');
$obj->set_base_path('..');
$obj->set_read_subdir(true);
// 输出POT文件内容 - Output the content of POT file
$obj->get_pot($potfile);
// 或生成POT文件 - Or write into POT file
$obj->write_pot('example.pot');
?>
下载 / Download
- 本站 – This Site: POTCreator [v1.0 - 4.32 kB - 41 Hits]
