diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index cb45c12351e..a48543a00f6 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -34,12 +34,12 @@ class box_project extends ModeleBoxes var $boximg="object_projectpub"; var $boxlabel; //var $depends = array("projet"); - + /** * @var DoliDB Database handler. */ public $db; - + var $param; var $info_box_head = array(); @@ -54,8 +54,9 @@ class box_project extends ModeleBoxes function __construct($db,$param='') { global $user, $langs; - $langs->load("boxes"); - $langs->load("projects"); + + // Load translation files required by the page + $langs->loadLangs(array('boxes', 'projects')); $this->db = $db; $this->boxlabel="Projects"; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index cdc6a20ffa1..86d631e8a6a 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -271,9 +271,8 @@ class FormMail extends Form if (! is_object($form)) $form=new Form($this->db); - $langs->load("other"); - $langs->load("mails"); - + // Load translation files required by the page + $langs->loadLangs(array('other', 'mails')); // Clear temp files. Must be done at beginning, before call of triggers if (GETPOST('mode','alpha') == 'init' || (GETPOST('modelmailselected','alpha') && GETPOST('modelmailselected','alpha') != '-1')) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index c0f4a3f75d2..5cad99b2a9f 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -126,9 +126,8 @@ class FormTicket { global $conf, $langs, $user, $hookmanager; - $langs->load("other"); - $langs->load("mails"); - $langs->load("ticket"); + // Load translation files required by the page + $langs->loadLangs(array('other', 'mails', 'ticket')); $form = new Form($this->db); $formcompany = new FormCompany($this->db); diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 4be484e1aa4..e8a7dfcb0ff 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -33,8 +33,8 @@ function categories_prepare_head($object,$type) { global $langs, $conf, $user; - $langs->load("categories"); - $langs->load("products"); + // Load translation files required by the page + $langs->loadLangs(array('categories', 'products')); $h = 0; $head = array(); @@ -48,7 +48,7 @@ function categories_prepare_head($object,$type) $head[$h][1] = $langs->trans("Photos"); $head[$h][2] = 'photos'; $h++; - + if (! empty($conf->global->MAIN_MULTILANGS)) { $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type; @@ -56,7 +56,7 @@ function categories_prepare_head($object,$type) $head[$h][2] = 'translation'; $h++; } - + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -87,7 +87,7 @@ function categoriesadmin_prepare_head() $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'setup'; $h++; - + $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCategories"); $head[$h][2] = 'attributes_categories'; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 783e6a0cb35..8a22337cea8 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -194,9 +194,10 @@ function dol_print_file($langs,$filename,$searchalt=0) */ function dol_print_object_info($object, $usetable=0) { - global $langs,$db; - $langs->load("other"); - $langs->load("admin"); + global $langs, $db; + + // Load translation files required by the page + $langs->loadLangs(array('other', 'admin')); include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 0d46dc7eacc..f138f161b9c 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -62,7 +62,6 @@ function payment_prepare_head(Paiement $object) */ function payment_supplier_prepare_head(Paiement $object) { - global $langs, $conf; $h = 0; @@ -127,8 +126,9 @@ function showOnlinePaymentUrl($type,$ref) { global $conf, $langs; - $langs->load("payment"); - $langs->load("paybox"); + // Load translation files required by the page + $langs->loadLangs(array('payment', 'paybox')); + $servicename='Online'; $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'
';