Fix translation

This commit is contained in:
Laurent Destailleur 2024-03-16 12:49:42 +01:00
parent 62827c14e6
commit 2b0a789289
3 changed files with 7 additions and 10 deletions

View File

@ -159,10 +159,10 @@ if ($action == 'confirm_deleteproperty' && GETPOST('confirm') == 'yes') {
$res = dolibarr_set_const($db, 'AI_CONFIGURATIONS_PROMPT', $newConfigurationsJson, 'chaine', 0, '', $conf->entity);
if ($res) {
header("Location: ".$_SERVER['PHP_SELF']);
setEventMessages($langs->trans("SetupDeleted"), null, 'mesgs');
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
exit;
} else {
setEventMessages($langs->trans("ErrorDeleting"), null, 'errors');
setEventMessages($langs->trans("NoRecordDeleted"), null, 'errors');
}
}
}

View File

@ -173,9 +173,6 @@ print load_fiche_titre($langs->trans($title), $linkback, 'title_setup');
$head = aiAdminPrepareHead();
print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "fa-microchip");
// Setup page goes here
//echo '<span class="opacitymedium">'.$langs->trans("AiSetupPage").'</span><br><br>';
if ($action == 'edit') {
print $formSetup->generateOutput(true);

View File

@ -68,12 +68,12 @@ $format = empty($jsonData['instructions']) ? '' : $jsonData['instructions'];
$generatedContent = $ai->generateContent($instructions, 'auto', $function, $format);
if (is_array($generatedContent) && $generatedContent['error']) {
// client errors
if ($generatedContent['code'] >= 400) {
print "Error : " . $generatedContent['message'];
print '<br><a href="'.DOL_MAIN_URL_ROOT.'/ai/admin/setup.php">'.$langs->trans('Check Config of Module').'</a>';
} elseif ($generatedContent['code'] == 429) {
// Output error
if ($generatedContent['code'] == 429) {
print "Quota or allowed period exceeded. Retry Later !";
} elseif ($generatedContent['code'] >= 400) {
print "Error : " . $generatedContent['message'];
print '<br><a href="'.DOL_MAIN_URL_ROOT.'/ai/admin/setup.php">'.$langs->trans('ErrorGoToModuleSetup').'</a>';
} else {
print "Error returned by API call: " . $generatedContent['message'];
}