$t->setFrom($row);
$t->setFrom($base);
unset($t->seqid); // these might have been changed
- unset($t->displayName); // these might have been changed
+ unset($t->display_name); // these might have been changed
if (!$t->find(true))
$x = DB_DataObject::factory('i18n');
$x->ltype = $ltype;
- $x->inlang= $inlang;
$x->lkey = $kval;
+ $x->inlang= $inlang;
+ $fallback = clone($x);
+
$x->limit(1);
- $x->find(true);
- return $x->lval;
+ if ($x->find(true)) {
+ return $x->lval;
+ }
+ $fallback->inlang = 'en';
+ $fallback->find(true);
+ return $fallback->lval;
}