/** * method: translateExtended * * todo: write documentation */ public function translateExtended($n, $i, $l = NULL) { $v = parent::translateExtended($n, $i, $l); if ($v == $n && is_numeric($i)) { $i = intval($i); $l = $this->getIdLang($l); $n = $this->database->escape($n); $r = $this->database->select("value from {$this->table} where name='{$n}' and id_object={$i} and id_lang='{$l}'"); $v = ""; if (is_array($r)) { if (count($r) > 1) { Amslib_Keystore::add(__METHOD__, "Multiple conflicting translations for key({$n}),id_object({$i}) and language({$l})"); } else { if (isset($r[0]["value"])) { $v = trim($r[0]["value"]); } } parent::learnExtended($n, $i, $v, $l); } else { $v = $n; } } else { die("FAIL 1: " . Amslib_Debug::pdump(true, $n, $i, $l, $v)); } return $v; }
/** * method: translateExtended * * todo: write documentation */ public function translateExtended($n, $i, $l = NULL) { $v = parent::translateExtended($n, $i, $l); if ($v == $n) { $text = trim($this->qp->find("database translation[key='{$n}']")->innerHTML()); if (strlen($text)) { parent::learnExtended($n, $i, $text, $l); return $text; } } return $v; }