本文整理汇总了PHP中Piwik::translate方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::translate方法的具体用法?PHP Piwik::translate怎么用?PHP Piwik::translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::translate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Loads all required data from Intl plugin
*/
public function __construct()
{
$this->patternNumber = Piwik::translate('Intl_NumberFormatNumber');
$this->patternCurrency = Piwik::translate('Intl_NumberFormatCurrency');
$this->patternPercent = Piwik::translate('Intl_NumberFormatPercent');
$this->symbolPlus = Piwik::translate('Intl_NumberSymbolPlus');
$this->symbolMinus = Piwik::translate('Intl_NumberSymbolMinus');
$this->symbolPercent = Piwik::translate('Intl_NumberSymbolPercent');
$this->symbolGroup = Piwik::translate('Intl_NumberSymbolGroup');
$this->symbolDecimal = Piwik::translate('Intl_NumberSymbolDecimal');
}
示例2: getFileIntegrityInformation
/**
* Get file integrity information (in PIWIK_INCLUDE_PATH).
*
* @return array(bool, string, ...) Return code (true/false), followed by zero or more error messages
*/
public static function getFileIntegrityInformation()
{
$messages = array();
$messages[] = true;
$manifest = PIWIK_INCLUDE_PATH . '/config/manifest.inc.php';
if (file_exists($manifest)) {
require_once $manifest;
}
if (!class_exists('Piwik\\Manifest')) {
$messages[] = Piwik::translate('General_WarningFileIntegrityNoManifest') . ' ' . Piwik::translate('General_WarningFileIntegrityNoManifestDeployingFromGit');
return $messages;
}
$files = \Piwik\Manifest::$files;
$hasMd5file = function_exists('md5_file');
$hasMd5 = function_exists('md5');
foreach ($files as $path => $props) {
$file = PIWIK_INCLUDE_PATH . '/' . $path;
if (!file_exists($file) || !is_readable($file)) {
$messages[] = Piwik::translate('General_ExceptionMissingFile', $file);
} else {
if (filesize($file) != $props[0]) {
if (!$hasMd5 || in_array(substr($path, -4), array('.gif', '.ico', '.jpg', '.png', '.swf'))) {
// files that contain binary data (e.g., images) must match the file size
$messages[] = Piwik::translate('General_ExceptionFilesizeMismatch', array($file, $props[0], filesize($file)));
} else {
// convert end-of-line characters and re-test text files
$content = @file_get_contents($file);
$content = str_replace("\r\n", "\n", $content);
if (strlen($content) != $props[0] || @md5($content) !== $props[1]) {
$messages[] = Piwik::translate('General_ExceptionFilesizeMismatch', array($file, $props[0], filesize($file)));
}
}
} else {
if ($hasMd5file && @md5_file($file) !== $props[1]) {
$messages[] = Piwik::translate('General_ExceptionFileIntegrity', $file);
}
}
}
}
if (count($messages) > 1) {
$messages[0] = false;
}
if (!$hasMd5file) {
$messages[] = Piwik::translate('General_WarningFileIntegrityNoMd5file');
}
return $messages;
}
示例3: remove
/**
* Removes one or more widgets from the widget list.
*
* @param string $widgetCategory The widget category. Can be a translation token.
* @param string|false $widgetName The name of the widget to remove. Cannot be a
* translation token. If not supplied, the entire category
* will be removed.
*/
public static function remove($widgetCategory, $widgetName = false)
{
if (!isset(self::$widgets[$widgetCategory])) {
return;
}
if (empty($widgetName)) {
unset(self::$widgets[$widgetCategory]);
return;
}
foreach (self::$widgets[$widgetCategory] as $id => $widget) {
if ($widget['name'] == $widgetName || $widget['name'] == Piwik::translate($widgetName)) {
unset(self::$widgets[$widgetCategory][$id]);
return;
}
}
}
示例4: getPercentVisitColumn
public static function getPercentVisitColumn()
{
$percentVisitsLabel = str_replace(' ', ' ', Piwik::translate('General_ColumnPercentageVisits'));
return $percentVisitsLabel;
}