示例#1
0
 /**
  * Loads the translations of this multilingual section.
  *
  * @param bool $untranslatedFirst Set to true to have untranslated strings first
  *
  * @return \Gettext\Translations
  */
 public function getSectionInterfaceTranslations($untranslatedFirst = false)
 {
     $translations = new Translations();
     $translations->setLanguage($this->getLocale());
     $translations->setPluralForms($this->getNumberOfPluralForms(), $this->getPluralsRule());
     $db = \Database::get();
     $r = $db->query("select *\n            from MultilingualTranslations\n            where mtSectionID = ?\n            order by " . ($untranslatedFirst ? "if(ifnull(msgstr, '') = '', 0, 1), " : "") . "mtID", [$this->getCollectionID()]);
     while ($row = $r->fetch()) {
         $t = Translation::getByRow($row);
         if (isset($t)) {
             $translations[] = $t;
         }
     }
     return $translations;
 }