當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IL10N::n方法代碼示例

本文整理匯總了PHP中OCP\IL10N::n方法的典型用法代碼示例。如果您正苦於以下問題:PHP IL10N::n方法的具體用法?PHP IL10N::n怎麽用?PHP IL10N::n使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OCP\IL10N的用法示例。


在下文中一共展示了IL10N::n方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: joinParameterList

 /**
  * Returns a list of grouped parameters
  *
  * 2 parameters are joined by "and":
  * => A and B
  * Up to 5 parameters are joined by "," and "and":
  * => A, B, C, D and E
  * More than 5 parameters are joined by "," and trimmed:
  * => A, B, C and #n more
  *
  * @param array $parameterList
  * @param array $plainParameterList
  * @param bool $highlightParams
  * @return string
  */
 protected function joinParameterList($parameterList, $plainParameterList, $highlightParams)
 {
     if (empty($parameterList)) {
         return '';
     }
     $count = sizeof($parameterList);
     $lastItem = array_pop($parameterList);
     if ($count === 1) {
         return $lastItem;
     } else {
         if ($count === 2) {
             $firstItem = array_pop($parameterList);
             return $this->l->t('%s and %s', array($firstItem, $lastItem));
         } else {
             if ($count <= 5) {
                 $list = implode($this->l->t(', '), $parameterList);
                 return $this->l->t('%s and %s', array($list, $lastItem));
             }
         }
     }
     $firstParams = array_slice($parameterList, 0, 3);
     $firstList = implode($this->l->t(', '), $firstParams);
     $trimmedParams = array_slice($plainParameterList, 3);
     $trimmedList = implode($this->l->t(', '), $trimmedParams);
     if ($highlightParams) {
         return $this->l->n('%s and <strong %s>%n more</strong>', '%s and <strong %s>%n more</strong>', $count - 3, array($firstList, 'class="has-tooltip" title="' . Util::sanitizeHTML($trimmedList) . '"'));
     }
     return $this->l->n('%s and %n more', '%s and %n more', $count - 3, array($firstList));
 }
開發者ID:enoch85,項目名稱:owncloud-testserver,代碼行數:44,代碼來源:parameterhelper.php

示例2: countUsers

 /**
  * @return WizardResult
  * @throws \Exception
  */
 public function countUsers()
 {
     $filter = $this->access->getFilterForUserCount();
     $usersTotal = $this->formatCountResult($this->countEntries($filter, 'users'));
     $output = self::$l->n('%s user found', '%s users found', $usersTotal, array($usersTotal));
     $this->result->addChange('ldap_user_count', $output);
     return $this->result;
 }
開發者ID:GitHubUser4234,項目名稱:core,代碼行數:12,代碼來源:Wizard.php


注:本文中的OCP\IL10N::n方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。