Fix translation of source of proposals

This commit is contained in:
Laurent Destailleur 2018-10-08 14:04:22 +02:00
parent d776fc423e
commit 7be9b6d94e
2 changed files with 7 additions and 3 deletions

View File

@ -2971,7 +2971,10 @@ class Form
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
$label=($langs->trans("DemandReasonType".$obj->code)!=("DemandReasonType".$obj->code)?$langs->trans("DemandReasonType".$obj->code):($obj->label!='-'?$obj->label:'')); $label=($obj->label!='-'?$obj->label:'');
if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
if ($langs->trans($obj->code) != $obj->code) $label=$langs->trans($obj->code); // So translation key SRC_XXX will work
$tmparray[$obj->rowid]['id'] =$obj->rowid; $tmparray[$obj->rowid]['id'] =$obj->rowid;
$tmparray[$obj->rowid]['code'] =$obj->code; $tmparray[$obj->rowid]['code'] =$obj->code;
$tmparray[$obj->rowid]['label']=$label; $tmparray[$obj->rowid]['label']=$label;
@ -3020,7 +3023,8 @@ class Form
{ {
print '<option value="'.$arraydemandreason['id'].'">'; print '<option value="'.$arraydemandreason['id'].'">';
} }
print $arraydemandreason['label']; $label=$arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
print $langs->trans($label);
print '</option>'; print '</option>';
} }
print '</select>'; print '</select>';

View File

@ -295,7 +295,7 @@ CurrencyCentINR=paisa
CurrencyCentSingINR=paise CurrencyCentSingINR=paise
CurrencyThousandthSingTND=thousandth CurrencyThousandthSingTND=thousandth
#### Input reasons ##### #### Input reasons #####
DemandReasonTypeSRC_INTE=Internet DemandReasonTypeSRC_INTE=Internetaaa
DemandReasonTypeSRC_CAMP_MAIL=Mailing campaign DemandReasonTypeSRC_CAMP_MAIL=Mailing campaign
DemandReasonTypeSRC_CAMP_EMAIL=EMailing campaign DemandReasonTypeSRC_CAMP_EMAIL=EMailing campaign
DemandReasonTypeSRC_CAMP_PHO=Phone campaign DemandReasonTypeSRC_CAMP_PHO=Phone campaign