diff --git a/htdocs/product.class.php b/htdocs/product.class.php
index ec3a12d4855..03dea67de58 100644
--- a/htdocs/product.class.php
+++ b/htdocs/product.class.php
@@ -125,13 +125,13 @@ class Product extends CommonObject
global $langs;
$this->db = $DB;
- $this->id = $id ;
+ $this->id = $id ;
$this->status = 0;
$this->stock_reel = 0;
$this->seuil_stock_alerte = 0;
-
$this->canvas = '';
- if ($id>0) $this->fetch($id);
+
+ if ($this->id > 0) $this->fetch($this->id);
}
/**
@@ -285,7 +285,7 @@ class Product extends CommonObject
if ($this->catid > 0)
{
require_once(DOL_DOCUMENT_ROOT ."/categories/categorie.class.php");
- $cat = new Categorie ($this->db, $this->catid);
+ $cat = new Categorie($this->db, $this->catid);
$cat->add_type($this,"product");
}
}
@@ -629,6 +629,7 @@ class Product extends CommonObject
{
while ( $obj = $this->db->fetch_object($result) )
{
+ //print 'lang='.$obj->lang.' current='.$current_lang.'
';
if( $obj->lang == $current_lang ) // si on a les traduct. dans la langue courant on les charge en infos principales.
{
$this->libelle = $obj->label;
diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php
index 103f9bde0f7..935c3bda268 100644
--- a/htdocs/translate.class.php
+++ b/htdocs/translate.class.php
@@ -86,7 +86,7 @@ class Translate {
// We redefine $srclang
$langpart=explode("_",$codetouse);
- //print "Short before _ : ".$langpart[0].'/ Short after _ : '.$langpart[1];
+ //print "Short before _ : ".$langpart[0].'/ Short after _ : '.$langpart[1].'
';
if (isset($langpart[1])) // If its a long code xx_YY
{
@@ -102,7 +102,7 @@ class Translate {
}
else { // If its a short code xx
// Array to convert short lang code into long code.
- $longforshort=array('ca'=>'ca_ES', 'nb'=>'nb_NO', 'no'=>'nb_NO');
+ $longforshort=array('en'=>'en_US', 'ca'=>'ca_ES', 'nb'=>'nb_NO', 'no'=>'nb_NO');
if (isset($longforshort[strtolower($langpart[0])])) $srclang=$longforshort[strtolower($langpart[0])];
else $srclang=strtolower($langpart[0])."_".strtoupper($langpart[0]);
}