31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-05-31 12:50:47 +00:00

Update language strings and messages on installation and uninstallation #264

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
Roland Dalmulder 2020-04-11 20:59:03 +02:00
parent 0dfa02c513
commit ed0c89567c
No known key found for this signature in database
GPG Key ID: FD49814C56AE3AF9
3 changed files with 72 additions and 49 deletions

View File

@ -15,8 +15,6 @@ COM_PATCHTESTER_CONFIGURATION="Joomla! Patch Tester Settings"
COM_PATCHTESTER_CONFIRM_RESET="Resetting will attempt to revert all applied patches and removes all backed up files. This may result in a corrupted environment. Are you sure you want to continue?"
COM_PATCHTESTER_CONFLICT_S="The patch could not be applied because it conflicts with a previously applied patch: %s"
COM_PATCHTESTER_COULD_NOT_CONNECT_TO_GITHUB="Could not connect to GitHub: %s"
COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES="Could not install the template overrides for the following templates: %s"
COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES="Could not remove the template overrides for the following templates: %s"
COM_PATCHTESTER_ERROR_APPLIED_PATCHES="Cannot fetch data from GitHub while there are applied patches. Please revert those patches before continuing."
COM_PATCHTESTER_ERROR_CANNOT_COPY_FILE="Cannot copy source file %1$s to destination %2$s"
COM_PATCHTESTER_ERROR_CANNOT_DELETE_FILE="Cannot delete file %s"
@ -78,27 +76,15 @@ COM_PATCHTESTER_FILTER_APPLIED_PATCHES="Filter Applied Patches"
COM_PATCHTESTER_FILTER_BRANCH="Filter Target Branch"
COM_PATCHTESTER_FILTER_RTC_PATCHES="Filter RTC Patches"
COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION="Search the list by title or prefix with 'id:' to search by Pull ID."
COM_PATCHTESTER_GOTO_PATCHTESTER="Go to <a href=""index.php?option=com_patchtester"" alt="Go to Patch Tester">Patch Tester</a>"
COM_PATCHTESTER_GOTO_PATCHTESTER_OPTIONS="Go to <a href=""index.php?option=com_config&view=component&component=com_patchtester#authentication"" alt="Go to Options">Options</a>"
COM_PATCHTESTER_GITHUB="GitHub"
COM_PATCHTESTER_HEADING_FETCH_DATA="Fetching GitHub Data"
COM_PATCHTESTER_INSTALL_TEXT="Patch Tester Install script"
COM_PATCHTESTER_JISSUE="J! Issue"
COM_PATCHTESTER_JISSUES="Issue Tracker"
COM_PATCHTESTER_LINK="Component"
COM_PATCHTESTER_NO_CREDENTIALS="You have not entered your user credentials in the Options. This will limit you to only 60 requests to the GitHub API per hour. Adding your credentials will allow 5,000 requests per hour."
COM_PATCHTESTER_NO_FILES_TO_PATCH="There are no files to patch from this pull request. This may mean that the files in the pull request are not present in your installation."
COM_PATCHTESTER_NO_ITEMS="No data has been retrieved from GitHub, please click the 'Fetch Data' button in the toolbar to retrieve the open pull requests."
COM_PATCHTESTER_NOT_APPLIED="Not Applied"
COM_PATCHTESTER_NOT_RTC="Not RTC"
COM_PATCHTESTER_POSTFLIGHT_DISCOVER_INSTALL_TEXT="Patch Tester postflight discover install script"
COM_PATCHTESTER_POSTFLIGHT_INSTALL_TEXT="Patch Tester postflight install script"
COM_PATCHTESTER_POSTFLIGHT_UNINSTALL_TEXT="Patch Tester postflight uninstall script"
COM_PATCHTESTER_POSTFLIGHT_UPDATE_TEXT="Patch Tester postflight update script"
COM_PATCHTESTER_PREFLIGHT_DISCOVER_INSTALL_TEXT="Patch Tester preflight discover install script"
COM_PATCHTESTER_PREFLIGHT_INSTALL_TEXT="Patch Tester preflight install script"
COM_PATCHTESTER_PREFLIGHT_UNINSTALL_TEXT="Patch Tester preflight uninstall script"
COM_PATCHTESTER_PREFLIGHT_UPDATE_TEXT="Patch Tester preflight update script"
COM_PATCHTESTER_PULL_ID="Pull ID"
COM_PATCHTESTER_PULL_ID_ASC="Pull ID ascending"
COM_PATCHTESTER_PULL_ID_DESC="Pull ID descending"
@ -118,12 +104,8 @@ COM_PATCHTESTER_SERVER_RESPONDED_NOT_200="The patch could not be applied either
COM_PATCHTESTER_TEST_THIS_PATCH="Test This Patch"
COM_PATCHTESTER_TOOLBAR_FETCH_DATA="Fetch Data"
COM_PATCHTESTER_TOOLBAR_RESET="Reset"
COM_PATCHTESTER_UNINSTALL_TEXT="Patch Tester Uninstall script"
COM_PATCHTESTER_UNINSTALL_THANK_YOU="Thank you for using Joomla! Patch Tester for testing patches for the latest version of Joomla!"
COM_PATCHTESTER_UPDATE_TEXT="Patch Tester Update script. Patch Tester now updated to version %s."
COM_PATCHTESTER_VIEW_ON_GITHUB="View on GitHub"
COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER="View on Joomla! Issue Tracker"
COM_PATCHTESTER_XML_DESCRIPTION="Component for pull request management testing"
COM_PATCHTESTER_ZIP_DOES_NOT_EXIST="The patch could not be applied because it couldn't be retrieved from server."
COM_PATCHTESTER_ZIP_EXTRACT_FAILED="The patch could not be applied because it couldn't be extracted."
COM_PATCHTESTER_PATCH_BREAKS_SITE="The patch could not be applied because it would break the site. Check the pull request to see if it is up-to-date."
COM_PATCHTESTER_PATCH_BREAKS_SITE="The patch could not be applied because it would break the site. Check the pull request to see if it is up-to-date."

View File

@ -7,7 +7,7 @@ COM_PATCHTESTER="Joomla! Patch Tester"
COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES="Could not install the template overrides for the following templates: %s"
COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES="Could not remove the template overrides for the following templates: %s"
COM_PATCHTESTER_XML_DESCRIPTION="Component for pull request management testing"
COM_PATCHTESTER_GOTO="Go to"
COM_PATCHTESTER_LINK="Component"
COM_PATCHTESTER_OPTIONS="Options"
COM_PATCHTESTER_UPDATE_TEXT="Patch Tester Update script. Patch Tester now updated to version %s."
COM_PATCHTESTER_UPDATE_TEXT="Patch Tester Update script. Patch Tester now updated to version %s."
COM_PATCHTESTER_INSTALL_INSTRUCTIONS="<p>Thank you for installing the Joomla! Patch Tester.</p><p>To use the Joomla! Patch Tester you first need to setup your GitHub credentials in the Joomla! Patch Tester Options. <a href=""index.php?option=com_config&view=component&component=com_patchtester&returnurl=aW5kZXgucGhwP29wdGlvbj1jb21fcGF0Y2h0ZXN0ZXI=#authentication"" alt="Go to Options">Go to the Joomla! Patch Tester Options</a> to setup your credentials. After clicking on Save & Close you will be taken to the Joomla! Patch Tester where you can start using the Patch Tester."
COM_PATCHTESTER_UPDATE_INSTRUCTIONS="<p>Thank you for updating the Joomla! Patch Tester.</p><p><a href=""index.php?option=com_patchtester"" alt="Go to Patch Tester">Go to the Joomla! Patch Tester</a></p>"
COM_PATCHTESTER_UNINSTALL_THANK_YOU="Thank you for using the Joomla! Patch Tester for testing patches for the latest version of Joomla!"

View File

@ -6,9 +6,10 @@
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
use Joomla\CMS\Installer\InstallerScript;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
/**
@ -37,6 +38,70 @@ class Com_PatchtesterInstallerScript extends InstallerScript
'/administrator/components/com_patchtester/PatchTester/Table',
'/components/com_patchtester',
);
Factory::getApplication()
->getLanguage()
->load('com_patchtester.sys', JPATH_ADMINISTRATOR, null, true);
}
/**
* Show the message on install.
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 4.0.0
*/
public function install(ComponentAdapter $parent): void
{
?>
<h1>
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
<?php echo Text::_('COM_PATCHTESTER'); ?>
</h1>
<p><?php echo Text::_('COM_PATCHTESTER_INSTALL_INSTRUCTIONS'); ?></p>
<?php
}
/**
* Show the message on install.
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 4.0.0
*/
public function update(ComponentAdapter $parent): void
{
?>
<h1>
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
<?php echo Text::_('COM_PATCHTESTER'); ?>
</h1>
<p><?php echo Text::_('COM_PATCHTESTER_UPDATE_INSTRUCTIONS'); ?></p>
<?php
}
/**
* Show the message on install.
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 4.0.0
*/
public function uninstall(ComponentAdapter $parent): void
{
?>
<h1>
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
</h1>
<p><?php echo Text::_('COM_PATCHTESTER_UNINSTALL_THANK_YOU'); ?></p>
<?php
}
/**
@ -49,32 +114,8 @@ class Com_PatchtesterInstallerScript extends InstallerScript
*
* @since 3.0.0
*/
public function postflight($type, $parent)
public function postflight(string $type, ComponentAdapter $parent): void
{
$this->removeFiles();
if ($type == 'install')
{
$language = JFactory::getLanguage();
$language->load('com_patchtester', JPATH_ADMINISTRATOR, null, true);
$language->load('com_patchtester', JPATH_SITE, null, true);
?>
<h1><img src="../media/com_patchtester/images/icon-48-patchtester.png"><?php echo Text::_('COM_PATCHTESTER'); ?></h1>
<p><?php echo Text::_('COM_PATCHTESTER_XML_DESCRIPTION'); ?></p>
<p><?php echo Text::_('COM_PATCHTESTER_GOTO_PATCHTESTER'); ?></a></p>
<p><?php echo Text::_('COM_PATCHTESTER_GOTO_PATCHTESTER_OPTIONS'); ?></a></p>
<?php
}
if ($type == 'uninstall')
{
$language = JFactory::getLanguage();
$language->load('com_patchtester', JPATH_ADMINISTRATOR, null, true);
$language->load('com_patchtester', JPATH_SITE, null, true);
?>
<h1><?php echo Text::_('COM_PATCHTESTER'); ?></h1>
<p><?php echo Text::_('COM_PATCHTESTER_UNINSTALL_THANK_YOU'); ?></p>
<?php
}
}
}