Jump to content

Traducciones con self::l('');


Yoshua9

Recommended Posts

Buenas tardes,
 
No consigo que las traducciones de un archivo php que me genera un pdf de factura me las traduzca a diferentes idiomas. 
No entiendo que ocurre.
 
Mi codigo es similar a este:

/*
	* Display price summation
	*/
   if (Configuration::get('PS_TAX') OR $order->total_products_wt != $order->total_products)
   {
	$pdf->Ln(5);
	$pdf->SetFont(self::fontname(), 'B', 8);
	$width = 165;
	$pdf->Cell($width, 0, self::l('Total products (tax excl.)').' : ', 0, 0, 'R');
	$pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true)), 0, 0, 'R');
	$pdf->Ln(4);
	$pdf->SetFont(self::fontname(), 'B', 8);
	$width = 165;
	$pdf->Cell($width, 0, self::l('Total shipping (tax excl.)').' : ', 0, 0, 'R');
	$pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2), self::$currency, true)), 0, 0, 'R');
	$pdf->Ln(4);
   }
   else
   {
	$pdf->Ln(5);
	$pdf->SetFont(self::fontname(), 'B', 8);
	$width = 165;
	$pdf->Cell($width, 0, self::l('Total products ').' : ', 0, 0, 'R');
	$pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true)), 0, 0, 'R');
	$pdf->Ln(4);
   }
   if (!self::$orderSlip AND self::$order->total_discounts != '0.00')
   {
	$pdf->Cell($width, 0, self::l('Total discounts (tax incl.)').' : ', 0, 0, 'R');
	$pdf->Cell(0, 0, (!self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_discounts, self::$currency, true)), 0, 0, 'R');
	$pdf->Ln(4);
   }
   if (isset(self::$order->total_wrapping) and ((float)(self::$order->total_wrapping) > 0))
   {
	$pdf->Cell($width, 0, self::l('Total gift-wrapping').' : ', 0, 0, 'R');
	if (self::$_priceDisplayMethod == PS_TAX_EXC)
	 $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['wrappingCostWithoutTax'], self::$currency, true)), 0, 0, 'R');
	else
	 $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_wrapping, self::$currency, true)), 0, 0, 'R');
	$pdf->Ln(4);
   }
   if (self::$order->total_shipping != '0.00' AND (!self::$orderSlip OR (self::$orderSlip AND self::$orderSlip->shipping_cost)))
   {
	if (self::$_priceDisplayMethod == PS_TAX_EXC)
				{
					$pdf->Cell($width, 0, self::l('Total shipping (tax excl.)').' : ', 0, 0, 'R');
	 $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2), self::$currency, true)), 0, 0, 'R');
				}
	else
				{ 
Link to comment
Share on other sites

¿Como puedo traducir una variable que recojo de la base de datos?

 

Tipo: 

 

$self::l($variable);

No se puede traducir un campo que recoges de la base de datos, para eso existen las tablas con el subfijo _lang que son justamente las que manejan el multi-idioma desde la base de datos, no es algo sencillo ni facil de explicar en este post ya que es muy extenso.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...