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


PHP Core\Translation類代碼示例

本文整理匯總了PHP中XLite\Core\Translation的典型用法代碼示例。如果您正苦於以下問題:PHP Translation類的具體用法?PHP Translation怎麽用?PHP Translation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getInputErrors

 public function getInputErrors(array $data)
 {
     $errors = parent::getInputErrors($data);
     if (empty($data['securesubmit_token'])) {
         $errors[] = \XLite\Core\Translation::lbl('Payment processed with errors. Please, try again or ask administrator');
     }
     return $errors;
 }
開發者ID:ChessMess,項目名稱:heartland-x-cart5-plugin,代碼行數:8,代碼來源:Securesubmit.php

示例2: executeHookHandler

 /**
  * Execute certain hook handler
  *
  * @return void
  */
 public function executeHookHandler()
 {
     \XLite\Core\Translation::getInstance()->reset();
     \XLite\Core\Database::getEM()->flush();
     \XLite\Core\Translation::getInstance()->resetDriver();
     \XLite\Core\Translation::getInstance()->translateByString('label');
     \XLite\Core\Database::getRepo('XLite\\Model\\TmpVar')->setVar(\XLite::CACHE_TIMESTAMP, intval(microtime(true)));
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:13,代碼來源:Main.php

示例3: checkFieldValidity

 /**
  * Check field validity
  *
  * @return boolean
  */
 protected function checkFieldValidity()
 {
     $result = parent::checkFieldValidity();
     if ($result && $this->getValue() && !preg_match('/^[\\-\\+]{1}([0-9]+)([\\.,]([0-9]+))?([%]{1})?$/Ss', $this->getValue())) {
         $result = false;
         $this->errorMessage = \XLite\Core\Translation::lbl('The value of the X field has an incorrect format', array('name' => $this->getLabel()));
     }
     return $result;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:14,代碼來源:Modifier.php

示例4: getLabels

 /**
  * Return list of product labels
  *
  * @param \XLite\Model\Product $product The product to look for
  *
  * @return array
  */
 protected function getLabels(\XLite\Model\Product $product)
 {
     $labels = parent::getLabels($product);
     if ($this->participateSale($product)) {
         $label = intval($product->getSalePercent()) . '% ' . \XLite\Core\Translation::getInstance()->translate('off');
         $labels += array('orange sale-price' => $label);
     }
     return $labels;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:16,代碼來源:ItemsList.php

示例5: checkFieldValidity

 /**
  * Check field validity
  *
  * @return boolean
  */
 protected function checkFieldValidity()
 {
     $result = parent::checkFieldValidity();
     if ($result && $this->getValue() && false === filter_var($this->getValue(), FILTER_VALIDATE_EMAIL)) {
         $result = false;
         $this->errorMessage = \XLite\Core\Translation::lbl('The value of the X field has an incorrect format', array('name' => $this->getLabel()));
     }
     return $result;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:14,代碼來源:Email.php

示例6: getInputErrors

 public function getInputErrors(array $data)
 {
     $errors = parent::getInputErrors($data);
     error_log(print_r($data, true));
     if (!isset($data['securesubmit_use_stored_card']) && empty($data['securesubmit_token']) || empty($data['securesubmit_token']) && $data['securesubmit_use_stored_card'] === 'new') {
         $errors[] = \XLite\Core\Translation::lbl('Payment processed with errors. Please, try again or ask administrator');
     }
     return $errors;
 }
開發者ID:hps,項目名稱:heartland-x-cart5-plugin,代碼行數:9,代碼來源:Securesubmit.php

示例7: checkFieldValidity

 /**
  * Check field validity
  *
  * @return boolean
  */
 protected function checkFieldValidity()
 {
     $result = parent::checkFieldValidity();
     if ($result && strlen($result) > $this->getParam(self::PARAM_MAX_LENGTH)) {
         $result = false;
         $this->errorMessage = \XLite\Core\Translation::lbl('The value of the X field should not be longer than Y', array('name' => $this->getLabel(), 'max' => $this->getParam(self::PARAM_MAX_LENGTH)));
     }
     return $result;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:14,代碼來源:String.php

示例8: getInputErrors

 /**
  * Get input errors
  *
  * @param array $data Input data
  *
  * @return array
  */
 public function getInputErrors(array $data)
 {
     $errors = parent::getInputErrors($data);
     foreach ($this->getInputDataLabels() as $k => $t) {
         if (!isset($data[$k]) || !$data[$k]) {
             $errors[] = \XLite\Core\Translation::lbl('X field is required', array('field' => $t));
         }
     }
     return $errors;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:17,代碼來源:PurchaseOrder.php

示例9: checkFieldValidity

 /**
  * Check field validity
  *
  * @return boolean
  */
 protected function checkFieldValidity()
 {
     $result = parent::checkFieldValidity();
     if ($result && $this->getValue()) {
         $parts = @parse_url($this->getValue());
         if (!$parts || !isset($parts['scheme']) || !isset($parts['host'])) {
             $result = false;
             $this->errorMessage = \XLite\Core\Translation::lbl('The value of the X field has an incorrect format', array('name' => $this->getLabel()));
         }
     }
     return $result;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:17,代碼來源:URL.php

示例10: checkRange

 /**
  * Check range 
  * 
  * @return boolean
  */
 protected function checkRange()
 {
     $result = true;
     if (!is_null($this->getParam(self::PARAM_MIN)) && $this->getValue() < $this->getParam(self::PARAM_MIN)) {
         $result = false;
         $this->errorMessage = \XLite\Core\Translation::lbl('The value of the X field must be greater than Y', array('name' => $this->getLabel(), 'min' => $this->formatDate($this->getParam(self::PARAM_MIN))));
     } elseif (!is_null($this->getParam(self::PARAM_MAX)) && $this->getValue() > $this->getParam(self::PARAM_MAX)) {
         $result = false;
         $this->errorMessage = \XLite\Core\Translation::lbl('The value of the X field must be less than Y', array('name' => $this->getLabel(), 'max' => $this->formatDate($this->getParam(self::PARAM_MAX))));
     }
     return $result;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:17,代碼來源:Date.php

示例11: getLabelTranslation

 /**
  * Get label translation 
  * 
  * @param string $code Language code OPTIONAL
  *  
  * @return \XLite\Model\LanguageLabelTranslation
  */
 public function getLabelTranslation($code = null)
 {
     $result = null;
     $query = \XLite\Core\Translation::getLanguageQuery($code);
     foreach ($query as $code) {
         $result = $this->getTranslation($code, true);
         if (isset($result) || 'en' == $code) {
             break;
         }
     }
     return $result;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:19,代碼來源:LanguageLabel.php

示例12: checkFieldValidity

 /**
  * Check field validity
  *
  * @return boolean
  */
 protected function checkFieldValidity()
 {
     $result = parent::checkFieldValidity();
     if ($result && $this->getValue()) {
         $validator = new \XLite\Core\Validator\SKU($this->getProductId());
         try {
             $validator->validate($this->getValue());
         } catch (\XLite\Core\Validator\Exception $exception) {
             $message = static::t($exception->getMessage(), $exception->getLabelArguments());
             $result = false;
             $this->errorMessage = \XLite\Core\Translation::lbl(($exception->getPublicName() ? static::t($exception->getPublicName()) . ': ' : '') . $message, array('name' => $this->getLabel()));
         }
     }
     return $result;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:20,代碼來源:SKU.php

示例13: checkFieldValidity

 /**
  * Check field validity
  *
  * @return boolean
  */
 protected function checkFieldValidity()
 {
     $result = parent::checkFieldValidity();
     if ($result && $this->getValue()) {
         $validator = new \XLite\Core\Validator\String\CleanURL(false, null, '\\XLite\\Module\\CDev\\SimpleCMS\\Model\\Page', \XLite\Core\Request::getInstance()->id);
         try {
             $validator->validate($this->getValue());
         } catch (\XLite\Core\Validator\Exception $exception) {
             $message = static::t($exception->getMessage(), $exception->getLabelArguments());
             $result = false;
             $this->errorMessage = \XLite\Core\Translation::lbl(($exception->getPublicName() ? static::t($exception->getPublicName()) . ': ' : '') . $message, array('name' => $this->getLabel()));
         }
     }
     return $result;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:20,代碼來源:CleanURL.php

示例14: __construct

 /**
  * Constructor
  *
  * @return void
  */
 public function __construct()
 {
     $this->em = \XLite\Core\Database::getEM();
     $this->translation = \XLite\Core\Translation::getInstance();
     $entities = \XLite\Core\Database::getCacheDriver()->fetch('quickEntities');
     if (!is_array($entities) || !$entities) {
         foreach ($this->em->getMetadataFactory()->getAllMetadata() as $md) {
             if (!$md->isMappedSuperclass && preg_match('/^XLite\\\\(?:Module\\\\([a-z0-9]+)\\\\)?Model\\\\(.+)$/iSs', $md->name, $m)) {
                 $key = ($m[1] ? $m[1] . '\\' : '') . $m[2];
                 $entities[$key] = $md->name;
             }
         }
         \XLite\Core\Database::getCacheDriver()->save('quickEntities', $entities);
     }
     $this->entities = $entities;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:21,代碼來源:QuickAccess.php

示例15: getLabel

 /**
  * Get field label
  *
  * @return string
  */
 public function getLabel()
 {
     return \XLite\Core\Translation::lbl('Authorize amount for card setup');
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:9,代碼來源:ZeroAuthAmount.php


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