| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | { |
| 32 | 32 | $t = round($seconds); |
| 33 | 33 | |
| 34 | 34 | $hours = ($t / 3600); |
| 35 | - $minutes = ($t / 60 % 60); | |
| 35 | + $minutes = (floor($t / 60) % 60); | |
| 36 | 36 | $seconds = $t % 60; |
| 37 | 37 | |
| 38 | 38 | return sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds); |
| 39 | 39 | } |
| @@ -84,13 +84,13 @@ | ||
| 84 | 84 | $file_path = self::get_importer_log_file_path($id, $session); |
| 85 | 85 | $fh = fopen($file_path, 'a'); |
| 86 | 86 | |
| 87 | 87 | if (!is_writable($file_path)) { |
| 88 | - throw new \Exception(sprintf("Importer status file is not writable: %s.", $file_path)); | |
| 88 | + throw new \Exception(sprintf(__("Importer status file is not writable: %s.", 'jc-importer'), $file_path)); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | if (false === $fh) { |
| 92 | - throw new \Exception(sprintf("Unable to open Importer status file: %s.", $file_path)); | |
| 92 | + throw new \Exception(sprintf(__("Unable to open Importer status file: %s.", 'jc-importer'), $file_path)); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | fputcsv($fh, [$counter, $type, $message]); |
| 96 | 96 | fclose($fh); |
| @@ -168,13 +168,13 @@ | ||
| 168 | 168 | { |
| 169 | 169 | $file = self::get_importer_status_file_path($id); |
| 170 | 170 | |
| 171 | 171 | if (false === file_exists($file) && false === file_put_contents($file, '')) { |
| 172 | - throw new \Exception("Unable to create status file: " . $file); | |
| 172 | + throw new \Exception(sprintf(__("Unable to create status file: %s", 'jc-importer'), $file)); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | if (!is_writable($file)) { |
| 176 | - throw new \Exception("Unable to write status file: " . $file); | |
| 176 | + throw new \Exception(sprintf(__("Unable to write status file: %s", 'jc-importer'), $file)); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | $f = fopen($file, 'r+'); |
| 180 | 180 | |