Skip to content
Snippets Groups Projects
Commit 07c828d3 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Introduce method loadLangs to save code lines

parent 02d9a41e
No related branches found
No related tags found
No related merge requests found
......@@ -43,12 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load('orders');
$langs->load('sendings');
$langs->load('deliveries');
$langs->load('companies');
$langs->load('compta');
$langs->load('bills');
$langs->loadLangs(array("orders",'sendings','deliveries','companies','compta','bills'));
$action=GETPOST('action','alpha');
$massaction=GETPOST('massaction','alpha');
......
......@@ -138,6 +138,20 @@ class Translate
}
/**
* Load translation files.
*
* @param array $domains Array of lang files to load
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
function loadLangs($domains)
{
foreach($domains as $domain)
{
$this->load($domain);
}
}
/**
* Load translation key-value for a particular file, into a memory array.
* If data for file already loaded, do nothing.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment