diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index e2ccbe25dd2..0779db4c71a 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -214,6 +214,15 @@ if (!is_numeric($conf->entity)) { //print "We work with data into entity instance number '".$conf->entity."'"; $conf->setValues($db); +// Set default language (must be after the setValues setting global conf 'MAIN_LANG_DEFAULT'. Page main.inc.php will overwrite langs->defaultlang with user value later) +if (!defined('NOREQUIRETRAN')) { + $langcode = (GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09', 1) : getDolGlobalString('MAIN_LANG_DEFAULT', 'auto')); + if (defined('MAIN_LANG_DEFAULT')) { // So a page can force the language whatever is setup and parameters in URL + $langcode = constant('MAIN_LANG_DEFAULT'); + } + $langs->setDefaultLang($langcode); +} + // Create object $mysoc (A thirdparty object that contains properties of companies managed by Dolibarr. if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; @@ -260,13 +269,3 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { $conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX = 1; } } - - -// Set default language (must be after the setValues setting global conf 'MAIN_LANG_DEFAULT'. Page main.inc.php will overwrite langs->defaultlang with user value later) -if (!defined('NOREQUIRETRAN')) { - $langcode = (GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09', 1) : getDolGlobalString('MAIN_LANG_DEFAULT', 'auto')); - if (defined('MAIN_LANG_DEFAULT')) { // So a page can force the language whatever is setup and parameters in URL - $langcode = constant('MAIN_LANG_DEFAULT'); - } - $langs->setDefaultLang($langcode); -} diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0508e7ac723..2442b730697 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4543,6 +4543,9 @@ class Societe extends CommonObject $this->town = getDolGlobalString('MAIN_INFO_SOCIETE_TOWN'); $this->region_code = getDolGlobalString('MAIN_INFO_SOCIETE_REGION'); + $this->currency_code = getDolGlobalString('MAIN_MONNAIE'); + $this->currency = currency_name($this->currency_code); + $this->socialobject = getDolGlobalString('MAIN_INFO_SOCIETE_OBJECT'); $this->note_private = getDolGlobalString('MAIN_INFO_SOCIETE_NOTE');