diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 3d0454f5423fe96414c08b25843323b90f108fb0..2dd9f08e18f4f4b53a179dc6085e7804bb0bf0d3 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -152,7 +152,7 @@ if (empty($reshook)) if (empty($object->ref)) { $error++; - setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); } if (! $error) @@ -183,7 +183,7 @@ if (empty($reshook)) if ($result > 0) { // Delete OK - setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); + setEventMessages("RecordDeleted", null, 'mesgs'); header("Location: ".dol_buildpath('/buildingmanagement/list.php',1)); exit; } diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b442a6266ec7383d27f15f7af5dadcb88983083f..8eef2b06b8b84e19071a8e218169dddb14768bd8 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -407,7 +407,7 @@ if ($action == 'update') if (! $datef && $percentage == 100) { $error++; $donotclearsession=1; - setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); $action = 'edit'; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f5dc621aaf346a254e94d3d9b55d141892134709..4672f7a88e29583f5e5e78f636210ab0c1971815 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4385,15 +4385,17 @@ function dol_htmloutput_events() /** * Get formated messages to output (Used to show messages on html output). + * This include also the translation of the message key. * - * @param string $mesgstring Message string - * @param array $mesgarray Messages array + * @param string $mesgstring Message string or message key + * @param string[] $mesgarray Array of message strings or message keys * @param string $style Style of message output ('ok' or 'error') * @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify) * @return string Return html output * * @see dol_print_error * @see dol_htmloutput_errors + * @see setEventMessages */ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0) { @@ -4478,14 +4480,15 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) /** * Print formated messages to output (Used to show messages on html output). * - * @param string $mesgstring Message - * @param array $mesgarray Messages array - * @param string $style Which style to use ('ok', 'warning', 'error') - * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) + * @param string $mesgstring Message string or message key + * @param string[] $mesgarray Array of message strings or message keys + * @param string $style Which style to use ('ok', 'warning', 'error') + * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) * @return void * * @see dol_print_error * @see dol_htmloutput_errors + * @see setEventMessages */ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1eb5d8d47babf3a633bccda0c15f60afa56882c3..7220e869350c58ece984e67e38ff9d6ef9329e5c 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -709,7 +709,7 @@ if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 && } else { - setEventMessages($langs->transnoentitiesnoconv("NOT_AUTHOR"), '', 'errors'); + setEventMessages("NOT_AUTHOR", '', 'errors'); } } diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 4da37cde779aade99f95d039c2580cd9a9009631..7a3762636562a1589867e9229d56a9a9d7cc48a1 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -339,8 +339,7 @@ if ($_REQUEST['action'] == 'download') } else { - //TODO: Translate - setEventMessage('Failed to get file '.$remotefile, 'errors'); + setEventMessages($langs->transnoentitiesnoconv('FailedToGetFile',$remotefile), null, 'errors'); } } diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index c0179c55bd0e49257b2321287017d6dc1bebb2d1..3c5d9f40ab4664326e8b8d3848f4da0349d6576c 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -102,7 +102,7 @@ if ($action == 'update' && isset($_POST['update_cp'])) } } - if (! $error) setEventMessages($langs->trans('UpdateConfCPOK'), '', 'mesgs'); + if (! $error) setEventMessages('UpdateConfCPOK', '', 'mesgs'); } elseif($action == 'add_event') { @@ -122,7 +122,7 @@ elseif($action == 'add_event') if ($error) { - setEventMessages($langs->trans('ErrorAddEventToUserCP'), '', 'errors'); + setEventMessages('ErrorAddEventToUserCP', '', 'errors'); } else { @@ -135,7 +135,7 @@ elseif($action == 'add_event') $holiday->updateSoldeCP($userCP,$new_holiday); - setEventMessages($langs->trans('AddEventToUserOkCP'), '', 'mesgs'); + setEventMessages('AddEventToUserOkCP', '', 'mesgs'); } } diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index f8e106a7e7e88e746b9e3c81ff6b24500b6c2295..93305dbc63cbe81f4880c12f7fdfd1db11714d5a 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -96,12 +96,12 @@ if ($action == 'assign') } else { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } if (! GETPOST('type')) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors'); $error++; } if (! $error) @@ -126,7 +126,7 @@ if ($action == 'assign') if (! $error) { - setEventMessages($langs->trans("TaskAssignedToEnterTime"), null); + setEventMessages("TaskAssignedToEnterTime", null); } $action=''; @@ -180,7 +180,7 @@ if ($action == 'addtime' && $user->rights->projet->creer) } else { - setEventMessages($langs->trans("ErrorBadDate"), null, 'errors'); + setEventMessages("ErrorBadDate", null, 'errors'); $error++; break; } diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 619803ecbc372f66c1cfdbc9cce191b73350543c..6201c601d180145de2f6ef21f2ac2f9d07243289 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -108,12 +108,12 @@ if ($action == 'assign') } else { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } if (! GETPOST('type')) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors'); $error++; } if (! $error) @@ -138,7 +138,7 @@ if ($action == 'assign') if (! $error) { - setEventMessages($langs->trans("TaskAssignedToEnterTime"), null); + setEventMessages("TaskAssignedToEnterTime", null); } $action=''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 79c4a123022f06590e99753b46fa63840e6aabfa..f545e3257127943e8671db91c60a5768b42a4bd8 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -482,7 +482,7 @@ if ($action == 'update' && ! $_POST["cancel"]) { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailedToCreateDir", $dir), $mesgs, 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFailedToCreateDir", $dir), $mesgs, 'errors'); } } }