Fix translation function - use dol_translate() instead of dol_gettext()

- Replace dol_gettext() with dol_translate() which is the correct Dolibarr function
- Fix fatal error: Call to undefined function dol_gettext()
- Use proper Dolibarr translation function for journal labels
This commit is contained in:
Frank Cools 2025-10-09 00:21:28 +02:00
parent 96288033a5
commit 01abbb8af9

View File

@ -1269,7 +1269,7 @@ class DeclarationTVA
$journal_label_result = $this->db->query($journal_label_sql);
if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) {
$journal_label_obj = $this->db->fetch_object($journal_label_result);
$translated_label = dol_gettext($journal_label_obj->label);
$translated_label = dol_translate($journal_label_obj->label);
$debit->journal_label = $translated_label;
error_log("DEBUG: Retrieved journal label: " . $journal_label_obj->label . " -> " . $translated_label);
} else {
@ -1324,7 +1324,7 @@ class DeclarationTVA
$journal_label_result = $this->db->query($journal_label_sql);
if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) {
$journal_label_obj = $this->db->fetch_object($journal_label_result);
$translated_label = dol_gettext($journal_label_obj->label);
$translated_label = dol_translate($journal_label_obj->label);
$credit->journal_label = $translated_label;
error_log("DEBUG: Retrieved journal label: " . $journal_label_obj->label . " -> " . $translated_label);
} else {