Fix: Label for payment by cheque using the wrong translation key

Fix: Option to overwrite translation did not work as expected
Fix: Bad translation for greece
This commit is contained in:
Laurent Destailleur 2012-11-02 15:41:09 +01:00
parent b83a4d4815
commit 753400ccf5
5 changed files with 74 additions and 50 deletions

View File

@ -388,6 +388,18 @@ class Translate
{ {
$str=$this->tab_translate[$key]; $str=$this->tab_translate[$key];
// Overwrite translation
$overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2
{
$tmparray=explode(',', $conf->global->$overwritekey);
foreach($tmparray as $tmp)
{
$tmparray2=explode(':',$tmp);
if ($tmparray2[0]==$key) { $str=$tmparray2[1]; break; }
}
}
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
if ($maxsize) $str=dol_trunc($str,$maxsize); if ($maxsize) $str=dol_trunc($str,$maxsize);
@ -401,17 +413,6 @@ class Translate
// Restore HTML tags // Restore HTML tags
$str=str_replace(array('__lt__','__gt__','__quot__'),array('<','>','"',),$str); $str=str_replace(array('__lt__','__gt__','__quot__'),array('<','>','"',),$str);
// Overwrite translation
if (! empty($conf->global->MAIN_OVERWRITE_TRANS)) // Overwrite translation with string1:newstring1,string2:newstring2
{
$tmparray=explode(',', $conf->global->MAIN_OVERWRITE_TRANS);
foreach($tmparray as $tmp)
{
$tmparray2=explode(':',$tmp);
if ($tmparray2[0]==$str) { $str=$tmparray2[1]; break; }
}
}
return $str; return $str;
} }
else // Translation is not available else // Translation is not available
@ -458,10 +459,24 @@ class Translate
*/ */
function transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4='') function transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4='')
{ {
global $conf;
if (! empty($this->tab_translate[$key])) // Translation is available if (! empty($this->tab_translate[$key])) // Translation is available
{ {
$str=$this->tab_translate[$key]; $str=$this->tab_translate[$key];
// Overwrite translation
$overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2
{
$tmparray=explode(',', $conf->global->$overwritekey);
foreach($tmparray as $tmp)
{
$tmparray2=explode(':',$tmp);
if ($tmparray2[0]==$key) { $str=$tmparray2[1]; break; }
}
}
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
} }
else else

View File

@ -590,25 +590,31 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3); $pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
$posy=$pdf->GetY()+1; $posy=$pdf->GetY()+1;
$pdf->SetXY($this->marge_gauche, $posy); if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
$pdf->SetFont('','', $default_font_size - 3); {
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0); $pdf->SetXY($this->marge_gauche, $posy);
$posy=$pdf->GetY()+2; $pdf->SetFont('','', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
} }
if ($conf->global->FACTURE_CHQ_NUMBER == -1) if ($conf->global->FACTURE_CHQ_NUMBER == -1)
{ {
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3); $pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
$posy=$pdf->GetY()+1; $posy=$pdf->GetY()+1;
$pdf->SetXY($this->marge_gauche, $posy); if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
$pdf->SetFont('','', $default_font_size - 3); {
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $pdf->SetXY($this->marge_gauche, $posy);
$posy=$pdf->GetY()+2; $pdf->SetFont('','', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
} }
} }
} }

View File

@ -708,25 +708,31 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3); $pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
$posy=$pdf->GetY()+1; $posy=$pdf->GetY()+1;
$pdf->SetXY($this->marge_gauche, $posy); if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
$pdf->SetFont('','', $default_font_size - 3); {
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0); $pdf->SetXY($this->marge_gauche, $posy);
$posy=$pdf->GetY()+2; $pdf->SetFont('','', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
} }
if ($conf->global->FACTURE_CHQ_NUMBER == -1) if ($conf->global->FACTURE_CHQ_NUMBER == -1)
{ {
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3); $pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
$posy=$pdf->GetY()+1; $posy=$pdf->GetY()+1;
$pdf->SetXY($this->marge_gauche, $posy); if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
$pdf->SetFont('','', $default_font_size - 3); {
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $pdf->SetXY($this->marge_gauche, $posy);
$posy=$pdf->GetY()+2; $pdf->SetFont('','', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
} }
} }
} }

View File

@ -624,25 +624,31 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3); $pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
$posy=$pdf->GetY()+1; $posy=$pdf->GetY()+1;
$pdf->SetXY($this->marge_gauche, $posy); if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
$pdf->SetFont('','', $default_font_size - 3); {
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0); $pdf->SetXY($this->marge_gauche, $posy);
$posy=$pdf->GetY()+2; $pdf->SetFont('','', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
} }
if ($conf->global->FACTURE_CHQ_NUMBER == -1) if ($conf->global->FACTURE_CHQ_NUMBER == -1)
{ {
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('','B', $default_font_size - 3); $pdf->SetFont('','B', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
$posy=$pdf->GetY()+1; $posy=$pdf->GetY()+1;
$pdf->SetXY($this->marge_gauche, $posy); if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
$pdf->SetFont('','', $default_font_size - 3); {
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $pdf->SetXY($this->marge_gauche, $posy);
$posy=$pdf->GetY()+2; $pdf->SetFont('','', $default_font_size - 3);
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
} }
} }
} }

View File

@ -322,18 +322,9 @@ NetToBePaid=Φόρος που πρέπει να πληρωθεί
PhoneNumber=Τηλ PhoneNumber=Τηλ
FullPhoneNumber=Τηλέφωνο FullPhoneNumber=Τηλέφωνο
TeleFax=Φαξ TeleFax=Φαξ
PrettyLittleSentence=Accept the amount of payments due by checks issued in my name as a Member of an accounting association approved by the Fiscal Administration.
IntracommunityVATNumber=Intracommunity number of VAT
PaymentByChequeOrderedTo=Check payment (including tax) are payable to %s send to
PaymentByChequeOrderedToShort=Check payment (including tax) are payable to
SendTo=Αποστολή σε SendTo=Αποστολή σε
PaymentByTransferOnThisBankAccount=Πληρωμή με έμβασμα στον ακόλουθο λογαριασμό PaymentByTransferOnThisBankAccount=Πληρωμή με έμβασμα στον ακόλουθο λογαριασμό
VATIsNotUsedForInvoice=* Non applicable VAT art-293B of CGI VATIsNotUsedForInvoice=* Non applicable VAT art-293B of CGI
LawApplicationPart1=By application of the law 80.335 of 12/05/80
LawApplicationPart2=the goods remain the property of
LawApplicationPart3=the seller until the complete cashing of
LawApplicationPart4=their price.
LimitedLiabilityCompanyCapital=SARL with Capital of
UseDiscount=Χρήση έκπτωσης UseDiscount=Χρήση έκπτωσης
UseCredit=Χρήση πίστωσης UseCredit=Χρήση πίστωσης
UseCreditNoteInInvoicePayment=Μείωση ποσού πληρωμής με αυτή την πίστωση UseCreditNoteInInvoicePayment=Μείωση ποσού πληρωμής με αυτή την πίστωση