当前位置: 首页>>代码示例>>PHP>>正文


PHP Piwik::translate方法代码示例

本文整理汇总了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');
 }
开发者ID:normimuc,项目名称:piwik,代码行数:14,代码来源:NumberFormatter.php

示例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;
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:52,代码来源:Filechecks.php

示例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;
         }
     }
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:24,代码来源:WidgetsList.php

示例4: getPercentVisitColumn

 public static function getPercentVisitColumn()
 {
     $percentVisitsLabel = str_replace(' ', ' ', Piwik::translate('General_ColumnPercentageVisits'));
     return $percentVisitsLabel;
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:5,代码来源:Metrics.php


注:本文中的Piwik::translate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。