Translated paper formats and size units in PDF admin page

This commit is contained in:
Marcos García 2012-09-11 00:36:49 +02:00
parent b3235887d3
commit f2393f08bc
2 changed files with 6 additions and 2 deletions

View File

@ -269,7 +269,9 @@ else // Show
if ($resql)
{
$obj=$db->fetch_object($resql);
$pdfformatlabel=$obj->label.' - '.round($obj->width).'x'.round($obj->height).' '.$obj->unit;
$paperKey = $langs->trans('PaperFormat'.$obj->code);
$unitKey = $langs->trans('SizeUnit'.$obj->unit);
$pdfformatlabel = ($paperKey == 'PaperFormat'.$obj->code ? $obj->label : $paperKey).' - '.round($obj->width).'x'.round($obj->height).' '.($unitKey == 'SizeUnit'.$obj->unit ? $obj->unit : $unitKey);
}
}
print $pdfformatlabel;

View File

@ -339,7 +339,9 @@ class FormAdmin
while ($i < $num)
{
$obj=$this->db->fetch_object($resql);
$paperformat[$obj->code]= $langs->trans('PaperFormat'.strtoupper($obj->code)).' - '.round($obj->width).'x'.round($obj->height).' '.$obj->unit;
$unitKey = $langs->trans('SizeUnit'.$obj->unit);
$paperformat[$obj->code]= $langs->trans('PaperFormat'.strtoupper($obj->code)).' - '.round($obj->width).'x'.round($obj->height).' '.($unitKey == 'SizeUnit'.$obj->unit ? $obj->unit : $unitKey);
$i++;
}