Jump to content

Quote multilangual + dutch translation


spetter

Recommended Posts

I changed the quote template so it uses language files. Here are the changes:

 

Template file:

<?php

$pdf->Image(ROOTDIR.'/images/logo.jpg',20,25);

$pdf->SetFont('freesans','',10);
foreach ($companyaddress AS $addressline) {
   $pdf->Cell(0,4,trim($addressline),0,1,'R');
}

$pdf->Ln(10);

$pdf->SetFont('freesans','B',10);
$pdf->SetX($pdf->GetX()+10);
$pdf->Cell(20,6,$_LANG["quotenumber"],1,0,'C');
$pdf->Cell(60,6,$_LANG["quotesubject"],1,0,'C');
$pdf->Cell(35,6,$_LANG["quotedatecreated"],1,0,'C');
$pdf->Cell(35,6,$_LANG["quotedatedue"],1,1,'C');

$pdf->SetFont('freesans','',9);
$pdf->SetX($pdf->GetX()+10);
$rowcount = $pdf->getNumLines($subject, 60);
$height = $rowcount * 5;
$pdf->MultiCell(20,$height,$quotenumber,1,'C',0,0);
$pdf->MultiCell(60,$height,$subject,1,'C',0,0);
$pdf->MultiCell(35,$height,$datecreated,1,'C',0,0);
$pdf->MultiCell(35,$height,$validuntil,1,'C',0,1);

$pdf->Ln(10);

$pdf->Cell(0,4,$_LANG["quotebillto"],0,1);
if ($clientsdetails["companyname"]) {
   $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L');
   $pdf->Cell(0,4,$_LANG["quoteattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else {
   $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');
}
$pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L');
if ($clientsdetails["address2"]) {
   $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L');
}
$pdf->Cell(0,4,$clientsdetails["postcode"],0,1,'L' . ' ' . $clientsdetails["city"]);
$pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');

$pdf->Ln(10);

$pdf->SetDrawColor(200);
$pdf->SetFillColor(239);

$pdf->SetFont('freesans','B',;

$pdf->Cell(15,6,$_LANG["quoteqty"],1,0,'C','1');
$pdf->Cell(80,6,$_LANG["quotedescription"],1,0,'C','1');
$pdf->Cell(25,6,$_LANG["quoteunitprice"],1,0,'C','1');
$pdf->Cell(25,6,$_LANG["quotediscount"],1,0,'C','1');
$pdf->Cell(25,6,$_LANG["quotetotal"],1,0,'C','1');

$pdf->Ln();

$pdf->SetFont('freesans','',;

foreach ($lineitems AS $item) {

   $rowcount = $pdf->getNumLines($item['description'], 80);
   $height = $rowcount * 5;

   $itemlines = explode("\n",$item['description']);
   $desc = '';
   foreach ($itemlines AS $itemline) $desc .= trim($itemline)."\n";

   $pdf->MultiCell(15,$height,$item['qty'],1,'C',0,0);
   $pdf->MultiCell(80,$height,$desc,1,'L',0,0);
   $pdf->MultiCell(25,$height,$item['unitprice'],1,'C',0,0);
   $pdf->MultiCell(25,$height,$item['discount'],1,'C',0,0);
   $pdf->MultiCell(25,$height,$item['total'],1,'C',0,0);

   $pdf->Ln();

}

$pdf->SetFont('freesans','B',;

$pdf->Cell(145,6,$_LANG["quotesubtotal"],1,0,'R','1');
$pdf->Cell(25,6,$subtotal,1,0,'C','1');
$pdf->Ln();

if ($taxlevel1["rate"]>0) {
   $pdf->Cell(145,6,$taxlevel1["name"]." @ ".$taxlevel1["rate"]."%",1,0,'R','1');
   $pdf->Cell(25,6,$tax1,1,0,'C','1');
   $pdf->Ln();
}

if ($taxlevel2["rate"]>0) {
   $pdf->Cell(145,6,$taxlevel2["name"]." @ ".$taxlevel2["rate"]."%",1,0,'R','1');
   $pdf->Cell(25,6,$tax2,1,0,'C','1');
   $pdf->Ln();
}

$pdf->Cell(145,6,$_LANG["quotetotal"],1,0,'R','1');
$pdf->Cell(25,6,$total,1,0,'C','1');
$pdf->Ln();

if ($notes) {
   $pdf->Ln(10);
   $pdf->SetFont('freesans','',;
   $pdf->MultiCell(170,5,$_LANG["quotenotes"].": $notes");
}

?>

 

English translation

$_LANG["quotenumber"] = "Quote #";

$_LANG["quotedatecreated"] = "Date Created";

$_LANG["quotedatedue"] = "Valid Until";

$_LANG["quotesubject"] = "Subject";

$_LANG["quotebillto"] = "Bill to";

$_LANG["quoteattn"] = "ATTN";

$_LANG["quoteqty"] = "Qty";

$_LANG["quotedescription"] = "Description";

$_LANG["quoteunitprice"] = "Unit Price";

$_LANG["quotediscount"] = "Discount %";

$_LANG["quotetotal"] = "Total";

$_LANG["quotesubtotal"] = "Subtotal";

$_LANG["quotenotes"] = "Notes";

 

Dutch translation

$_LANG["quotenumber"] = "Offerte #";

$_LANG["quotedatecreated"] = "Aangemaakt op";

$_LANG["quotedatedue"] = "Geldig tot";

$_LANG["quotesubject"] = "Onderwerp";

$_LANG["quotebillto"] = "Factureer aan";

$_LANG["quoteattn"] = "T.a.v";

$_LANG["quoteqty"] = "Aantal";

$_LANG["quotedescription"] = "Beschrijving";

$_LANG["quoteunitprice"] = "Prijs per stuk";

$_LANG["quotediscount"] = "Korting %";

$_LANG["quotetotal"] = "Totaal";

$_LANG["quotesubtotal"] = "Subtotaal";

$_LANG["quotenotes"] = "Opmerkingen";

Link to comment
Share on other sites

Hi

 

Thank you for this template

 

and here's the Arabic translation

 

$_LANG["quotenumber"] = "أقتباس #";

$_LANG["quotedatecreated"] = "تاريخ الانشاء";

$_LANG["quotedatedue"] = "صالحة حتى";

$_LANG["quotesubject"] = "الموضوع";

$_LANG["quotebillto"] = "فاتورة إلى";

$_LANG["quoteattn"] = "عناية";

$_LANG["quoteqty"] = "الكميه";

$_LANG["quotedescription"] = "الوصف";

$_LANG["quoteunitprice"] = "سعر الوحدة";

$_LANG["quotediscount"] = "التخفيض %";

$_LANG["quotetotal"] = "المجموع";

$_LANG["quotesubtotal"] = "المجموع الكلي";

$_LANG["quotenotes"] = "الملاحظات";

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

 

Thanks for this template.

Here's the French translation:

 

$_LANG["quotenumber"] = "Devis N°";

$_LANG["quotedatecreated"] = "Généré le";

$_LANG["quotedatedue"] = "Valide jusqu'au";

$_LANG["quotesubject"] = "Objet";

$_LANG["quotebillto"] = "Facturer à";

$_LANG["quoteattn"] = "A/S";

$_LANG["quoteqty"] = "Qté";

$_LANG["quotedescription"] = "Description";

$_LANG["quoteunitprice"] = "Prix unitaire";

$_LANG["quotediscount"] = "% rabais";

$_LANG["quotetotal"] = "Total";

$_LANG["quotesubtotal"] = "Sous-total";

$_LANG["quotenotes"] = "Remarques";

 

 

Josee Marianne Proulx, C.Tr.

Certified Translator and Programmer

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated