From 742b775f3773b31bc064ca6b291407b26778c615 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2008 02:18:54 +0000 Subject: [PATCH] Fix: decimal support for italian language --- htdocs/facture.class.php | 2 +- htdocs/lib/functions.lib.php | 3 ++- htdocs/translate.class.php | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index cace21f67eb..3d42646825b 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -1312,7 +1312,7 @@ class Facture extends CommonObject $pu_ht=price2num($pu_ht); $pu_ttc=price2num($pu_ttc); $txtva=price2num($txtva); - + if ($price_base_type=='HT') { $pu=$pu_ht; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 62d8fda0181..ac0cadf26e2 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -2100,7 +2100,8 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1) $dec=','; $thousand=' '; if ($langs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->trans("SeparatorDecimal"); if ($langs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$langs->trans("SeparatorThousand"); - + + //print 'x'.$dec.$thousand.'-'; if ($alreadysqlnb != 1) // If not a PHP number or unknown, we change format { if ($thousand != ',' && $thousand != '.') $amount=str_replace(',','.',$amount); // To accept 2 notations for french users diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index 7f6731c9b6c..675670b845c 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -265,8 +265,11 @@ class Translate { //if ($this->charset_inputfile == 'UTF-8') $value=utf8_decode($value); if ($this->charset_inputfile == 'ISO-8859-1') $value=utf8_encode($value); - //$this->setTransFromTab($key,$value); - $this->tab_translate[$key]=$value; + // We do not load Separator values for alternate files + if (! $alt || (! eregi('^Separator',$key))) + { + $this->tab_translate[$key]=$value; + } if ($enablelangcacheinsession) $tabtranslatedomain[$key]=$value; // To save lang in session } }