Skip to content

Commit a56f449

Browse files
author
Michael Babker
committed
Remove some hardcoded English
1 parent ebae3ab commit a56f449

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

administrator/components/com_patchtester/PatchTester/Controller/DisplayController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function execute()
101101
if (!class_exists($viewClass))
102102
{
103103
throw new \RuntimeException(
104-
sprintf('The view class for the %1$s view in the %2$s was not found.', $view, $format), 500
104+
sprintf('The view class for the %1$s view in the %2$s format was not found.', $view, $format), 500
105105
);
106106
}
107107
}

administrator/components/com_patchtester/PatchTester/Model/PullModel.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ COM_PATCHTESTER_CONFIGURATION="Joomla! Patch Tester Settings"
1515
COM_PATCHTESTER_CONFLICT_S="The patch could not be applied because it conflicts with a previously applied patch: %s"
1616
COM_PATCHTESTER_COULD_NOT_CONNECT_TO_GITHUB="Could not connect to GitHub with the following error: %s"
1717
COM_PATCHTESTER_ERROR_APPLIED_PATCHES="Cannot fetch data from GitHub while there are applied patches. Please revert those patches before continuing."
18+
COM_PATCHTESTER_ERROR_CANNOT_COPY_FILE="Cannot copy source file %1$s to destination %2$s"
19+
COM_PATCHTESTER_ERROR_CANNOT_DELETE_FILE="Cannot delete file %s"
20+
COM_PATCHTESTER_ERROR_CANNOT_WRITE_FILE="Cannot write file %s"
1821
COM_PATCHTESTER_ERROR_GITHUB_FETCH="Error retrieving pull requests from GitHub: %s"
1922
COM_PATCHTESTER_ERROR_INSERT_DATABASE="Error inserting pull request data into the database: %s"
23+
COM_PATCHTESTER_ERROR_READING_DATABASE_TABLE="%1$s - Error retrieving table data (%2$s)"
2024
COM_PATCHTESTER_FETCH_AN_ERROR_HAS_OCCURRED="An error has occurred while fetching the data from GitHub."
2125
COM_PATCHTESTER_FETCH_COMPLETE_CLOSE_WINDOW="All data has been retrieved. Please close this modal window to refresh the page."
2226
COM_PATCHTESTER_FETCH_INITIALIZING="Preparing to fetch GitHub data"

0 commit comments

Comments
 (0)