Introduce method loadLangs to save code lines
This commit is contained in:
parent
02d9a41e77
commit
07c828d38f
@ -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.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
$langs->load('orders');
|
$langs->loadLangs(array("orders",'sendings','deliveries','companies','compta','bills'));
|
||||||
$langs->load('sendings');
|
|
||||||
$langs->load('deliveries');
|
|
||||||
$langs->load('companies');
|
|
||||||
$langs->load('compta');
|
|
||||||
$langs->load('bills');
|
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$massaction=GETPOST('massaction','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.
|
* Load translation key-value for a particular file, into a memory array.
|
||||||
* If data for file already loaded, do nothing.
|
* If data for file already loaded, do nothing.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user