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


PHP Translation::getExtractedComments方法代码示例

本文整理汇总了PHP中Translation::getExtractedComments方法的典型用法代码示例。如果您正苦于以下问题:PHP Translation::getExtractedComments方法的具体用法?PHP Translation::getExtractedComments怎么用?PHP Translation::getExtractedComments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Translation的用法示例。


在下文中一共展示了Translation::getExtractedComments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mergeExtractedComments

 /**
  * Merge the extracted comments of two translations.
  * 
  * @param Translation $from
  * @param Translation $to
  * @param int         $options
  */
 public static function mergeExtractedComments(Translation $from, Translation $to, $options = self::DEFAULTS)
 {
     if ($options & self::EXTRACTED_COMMENTS_THEIRS) {
         $to->deleteExtractedComments();
     }
     if (!($options & self::EXTRACTED_COMMENTS_OURS)) {
         foreach ($from->getExtractedComments() as $comment) {
             $to->addExtractedComment($comment);
         }
     }
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:18,代码来源:Merge.php

示例2: mergeWith

 /**
  * Merges this translation with other translation
  *
  * @param Translation  $translation The translation to merge with
  * @param integer|null $method      One or various Translations::MERGE_* constants to define how to merge the translations
  */
 public function mergeWith(Translation $translation, $method = null)
 {
     if ($method === null) {
         $method = Translations::$mergeDefault;
     }
     if (!$this->hasTranslation()) {
         $this->setTranslation($translation->getTranslation());
     }
     if ($method & Translations::MERGE_PLURAL && !$this->hasPlural()) {
         $this->setPlural($translation->getPlural());
     }
     if ($this->hasPlural() && !$this->hasPluralTranslation() && $translation->hasPluralTranslation()) {
         $this->pluralTranslation = $translation->getPluralTranslation();
     }
     if ($method & Translations::MERGE_REFERENCES) {
         foreach ($translation->getReferences() as $reference) {
             $this->addReference($reference[0], $reference[1]);
         }
     }
     if ($method & Translations::MERGE_COMMENTS) {
         $this->comments = array_values(array_unique(array_merge($translation->getComments(), $this->comments)));
         $this->extractedComments = array_values(array_unique(array_merge($translation->getExtractedComments(), $this->extractedComments)));
         $this->flags = array_values(array_unique(array_merge($translation->getFlags(), $this->flags)));
     }
 }
开发者ID:yakamoz-fang,项目名称:concrete,代码行数:31,代码来源:Translation.php


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