diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 339ca17396dc6..3f2a1ca1fdb45 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -4,9 +4,10 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Marcos García - * Copyright (C) 2016-2023 Charlene Benke + * Copyright (C) 2016-2023 Charlene Benke * Copyright (C) 2018-2023 Frédéric France * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2024 Mélina Joum * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1464,6 +1465,11 @@ public function getExtrafieldsInHtml($object, $outputlangs, $params = array()) continue; } + // Load language if required + if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) { + $outputlangs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); + } + $field = new stdClass(); $field->rank = intval($extrafields->attributes[$object->table_element]['pos'][$key]); $field->content = $this->getExtrafieldContent($object, $key, $outputlangs);