本文整理匯總了PHP中l10n::generatePhpFileFromPo方法的典型用法代碼示例。如果您正苦於以下問題:PHP l10n::generatePhpFileFromPo方法的具體用法?PHP l10n::generatePhpFileFromPo怎麽用?PHP l10n::generatePhpFileFromPo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類l10n
的用法示例。
在下文中一共展示了l10n::generatePhpFileFromPo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Copyright
#!/usr/bin/env php
<?php
$license_block = <<<EOF
# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
EOF;
require dirname(__FILE__) . '/../inc/libs/clearbricks/common/lib.l10n.php';
$path = !empty($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : getcwd();
$path = realpath($path);
$cmd = 'find ' . $path . ' -type f -name \'*.po\'';
exec($cmd, $eres, $ret);
$res = array();
foreach ($eres as $f) {
$dest = dirname($f) . '/' . basename($f, '.po') . '.lang.php';
echo "l10n file " . $dest . ": ";
if (l10n::generatePhpFileFromPo(dirname($f) . '/' . basename($f, '.po'), $license_block)) {
echo 'OK';
} else {
echo 'FAILED';
}
echo "\n";
}