diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php
index a549485ac4c..80e9a5a3de7 100644
--- a/htdocs/core/class/html.formsms.class.php
+++ b/htdocs/core/class/html.formsms.class.php
@@ -88,7 +88,6 @@ class FormSms
return 1;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Show the form to input an sms.
*
@@ -96,16 +95,15 @@ class FormSms
* @param int $showform Show form tags and submit button (recommanded is to use with value 0)
* @return void
*/
+ // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function show_form($morecss='titlefield', $showform=1)
{
- // phpcs:enable
global $conf, $langs, $user, $form;
if (! is_object($form)) $form=new Form($this->db);
- $langs->load("other");
- $langs->load("mails");
- $langs->load("sms");
+ // Load translation files required by the page
+ $langs->loadLangs(array('other', 'mails', 'sms'));
$soc=new Societe($this->db);
if (!empty($this->withtosocid) && $this->withtosocid > 0)
diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php
index 074760e88ca..2a7d73dea63 100644
--- a/htdocs/core/datepicker.php
+++ b/htdocs/core/datepicker.php
@@ -41,8 +41,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
-$langs->load("main");
-$langs->load("agenda");
+// Load translation files required by the page
+$langs->loadLangs(array("main","agenda"));
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index 3f266e700cc..f4f178031de 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -28,8 +28,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
-$langs->load("products");
-$langs->load("other");
+// Load translation files required by the page
+$langs->loadLangs(array("products","other"));
$id=GETPOST('id','int');
$action=GETPOST('action','alpha');
diff --git a/htdocs/core/tools.php b/htdocs/core/tools.php
index 25e2eb3f903..3ceaaf17d33 100644
--- a/htdocs/core/tools.php
+++ b/htdocs/core/tools.php
@@ -24,8 +24,8 @@
require '../main.inc.php';
-$langs->load("companies");
-$langs->load("other");
+// Load translation files required by the page
+$langs->loadLangs(array("companies","other"));
// Security check
$socid=0;
diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
index 00a58667f43..246826106f7 100644
--- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
+++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
@@ -117,10 +117,9 @@ class InterfaceStripe
// Put here code you want to execute when a Dolibarr business events occurs.
// Data and type of action are stored into $object and $action
global $langs, $db, $conf;
- $langs->load("members");
- $langs->load("users");
- $langs->load("mails");
- $langs->load('other');
+
+ // Load translation files required by the page
+ $langs->loadLangs(array("members","other","users","mails"));
require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
$stripe = new Stripe($db);
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index 7459bf82453..177b2b82d8b 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -40,9 +40,8 @@ if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
-$langs->load("other");
-$langs->load("donations");
-$langs->load("companies");
+// Load translation files required by the page
+$langs->loadLangs(array("companies","other","donations"));
$id = GETPOST('id','int');
$ref = GETPOST('ref', 'alpha');
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 1e7d93302d8..782a3afba75 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -28,8 +28,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
-$langs->load("companies");
-$langs->load("donations");
+// Load translation files required by the page
+$langs->loadLangs(array("companies","donations"));
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
diff --git a/htdocs/don/note.php b/htdocs/don/note.php
index d78aa2c7ea5..3a5c55f7c6d 100644
--- a/htdocs/don/note.php
+++ b/htdocs/don/note.php
@@ -35,9 +35,8 @@ if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
-$langs->load("companies");
-$langs->load("bills");
-$langs->load("donations");
+// Load translation files required by the page
+$langs->loadLangs(array("companies","bills","donations"));
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref=GETPOST('ref','alpha');
diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php
index cb574da939a..224e674e9da 100644
--- a/htdocs/don/stats/index.php
+++ b/htdocs/don/stats/index.php
@@ -47,9 +47,8 @@ $year = GETPOST('year')>0?GETPOST('year'):$nowyear;
$startyear=$year-1;
$endyear=$year;
-$langs->load("sendings");
-$langs->load("other");
-$langs->load("companies");
+// Load translation files required by the page
+$langs->loadLangs(array("companies","other","sendings"));
/*