@@ -224,7 +224,11 @@ public function apply($id)
224224 if (!\JFile::copy (\JPath::clean (JPATH_ROOT . '/ ' . $ file ->old ), JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt ' ))
225225 {
226226 throw new \RuntimeException (
227- sprintf ('Can not copy file %s to %s ' , JPATH_ROOT . '/ ' . $ file ->old , JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt ' )
227+ \JText::sprintf (
228+ 'COM_PATCHTESTER_ERROR_CANNOT_COPY_FILE ' ,
229+ JPATH_ROOT . '/ ' . $ file ->old ,
230+ JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt '
231+ )
228232 );
229233 }
230234 }
@@ -235,15 +239,15 @@ public function apply($id)
235239 case 'added ' :
236240 if (!\JFile::write (\JPath::clean (JPATH_ROOT . '/ ' . $ file ->new ), $ file ->body ))
237241 {
238- throw new \RuntimeException (sprintf ('Can not write the file: %s ' , JPATH_ROOT . '/ ' . $ file ->new ));
242+ throw new \RuntimeException (\JText:: sprintf ('COM_PATCHTESTER_ERROR_CANNOT_WRITE_FILE ' , JPATH_ROOT . '/ ' . $ file ->new ));
239243 }
240244
241245 break ;
242246
243247 case 'deleted ' :
244248 if (!\JFile::delete (\JPath::clean (JPATH_ROOT . '/ ' . $ file ->old )))
245249 {
246- throw new \RuntimeException (sprintf ('Can not delete the file: %s ' , JPATH_ROOT . '/ ' . $ file ->old ));
250+ throw new \RuntimeException (\JText:: sprintf ('COM_PATCHTESTER_ERROR_CANNOT_DELETE_FILE ' , JPATH_ROOT . '/ ' . $ file ->old ));
247251 }
248252
249253 break ;
@@ -292,7 +296,7 @@ public function revert($id)
292296
293297 if (!$ files )
294298 {
295- throw new \RuntimeException (sprintf ( \JText::_ ( ' %s - Error retrieving table data (%s) ' ) , __METHOD__ , htmlentities ($ table ->data )));
299+ throw new \RuntimeException (\JText::sprintf ( ' COM_PATCHTESTER_ERROR_READING_DATABASE_TABLE ' , __METHOD__ , htmlentities ($ table ->data )));
296300 }
297301
298302 jimport ('joomla.filesystem.file ' );
@@ -306,8 +310,8 @@ public function revert($id)
306310 if (!\JFile::copy (JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt ' , JPATH_ROOT . '/ ' . $ file ->old ))
307311 {
308312 throw new \RuntimeException (
309- sprintf (
310- \JText:: _ ( ' Can not copy file %s to %s ' ) ,
313+ \JText:: sprintf (
314+ ' COM_PATCHTESTER_ERROR_CANNOT_COPY_FILE ' ,
311315 JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt ' ,
312316 JPATH_ROOT . '/ ' . $ file ->old
313317 )
@@ -316,15 +320,19 @@ public function revert($id)
316320
317321 if (!\JFile::delete (JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt ' ))
318322 {
319- throw new \RuntimeException (sprintf (\JText::_ ('Can not delete the file: %s ' ), JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt ' ));
323+ throw new \RuntimeException (
324+ \JText::sprintf ('COM_PATCHTESTER_ERROR_CANNOT_DELETE_FILE ' , JPATH_COMPONENT . '/backups/ ' . md5 ($ file ->old ) . '.txt ' )
325+ );
320326 }
321327
322328 break ;
323329
324330 case 'added ' :
325331 if (!\JFile::delete (\JPath::clean (JPATH_ROOT . '/ ' . $ file ->new )))
326332 {
327- throw new \RuntimeException (sprintf (\JText::_ ('Can not delete the file: %s ' ), JPATH_ROOT . '/ ' . $ file ->new ));
333+ throw new \RuntimeException (
334+ \JText::sprintf ('COM_PATCHTESTER_ERROR_CANNOT_DELETE_FILE ' , JPATH_ROOT . '/ ' . $ file ->new )
335+ );
328336 }
329337
330338 break ;
0 commit comments