diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 1e667e7abb4..998ce46314d 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -116,7 +116,7 @@ if ($action == 'update') { $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".((int) GETPOST('rowid', 'int')); $result = $db->query($sql); - if ($result > 0) { + if ($result) { $db->commit(); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action = ""; @@ -154,7 +154,7 @@ if ($action == 'add') { $sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".((int) $conf->entity).")"; $result = $db->query($sql); - if ($result > 0) { + if ($result) { $db->commit(); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action = ""; @@ -176,7 +176,7 @@ if ($action == 'add') { if ($action == 'delete') { $sql = "DELETE FROM ".MAIN_DB_PREFIX."overwrite_trans WHERE rowid = ".((int) $id); $result = $db->query($sql); - if ($result >= 0) { + if ($result) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } else { dol_print_error($db); @@ -296,7 +296,7 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) { $result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite $result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only - if ($result < 0) { + if (!$result) { print 'Failed to load language file '.$tmpfile.'
'."\n"; } else { $listoffiles[$langkey] = $tmpfile;