29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-05-28 07:53:37 +00:00

Revert "Add a text function for plugins (#41081)" (#41385)

This reverts commit b9d646cc0c.
This commit is contained in:
Allon Moritz 2023-08-18 13:07:21 +02:00 committed by GitHub
parent 315d47dca5
commit b27b429357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 25 deletions

View File

@ -390,22 +390,4 @@ abstract class CMSPlugin implements DispatcherAwareInterface, PluginInterface, L
$this->setLanguage($application->getLanguage());
}
}
/**
* Returns the string for the given key from the internal language object.
*
* @param string $key The key
*
* @return string
*
* @since 4.4.0
*/
protected function text(string $key): string
{
try {
return $this->getLanguage()->_($key);
} catch (\UnexpectedValueException $e) {
return $this->getApplication()->getLanguage()->_($key);
}
}
}

View File

@ -37,7 +37,7 @@ $return = $this->getApplication()->getInput()->getBase64('return');
$maxSizeBytes = FilesystemHelper::fileUploadMaxSize(false);
$maxSize = HTMLHelper::_('number.bytes', $maxSizeBytes);
?>
<legend><?php echo $this->text('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_INSTALL_JOOMLA_EXTENSION'); ?></legend>
<legend><?php echo Text::_('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_INSTALL_JOOMLA_EXTENSION'); ?></legend>
<div id="uploader-wrapper">
<div id="dragarea" data-state="pending">
@ -57,7 +57,7 @@ $maxSize = HTMLHelper::_('number.bytes', $maxSizeBytes);
</div>
<p class="lead">
<span class="uploading-text">
<?php echo $this->text('PLG_INSTALLER_PACKAGEINSTALLER_UPLOADING'); ?>
<?php echo Text::_('PLG_INSTALLER_PACKAGEINSTALLER_UPLOADING'); ?>
</span>
<span class="uploading-number">0</span><span class="uploading-symbol">%</span>
</p>
@ -68,18 +68,18 @@ $maxSize = HTMLHelper::_('number.bytes', $maxSizeBytes);
</div>
<p class="lead">
<span class="installing-text">
<?php echo $this->text('PLG_INSTALLER_PACKAGEINSTALLER_INSTALLING'); ?>
<?php echo Text::_('PLG_INSTALLER_PACKAGEINSTALLER_INSTALLING'); ?>
</span>
</p>
</div>
<div class="upload-actions">
<p class="lead">
<?php echo $this->text('PLG_INSTALLER_PACKAGEINSTALLER_DRAG_FILE_HERE'); ?>
<?php echo Text::_('PLG_INSTALLER_PACKAGEINSTALLER_DRAG_FILE_HERE'); ?>
</p>
<p>
<button id="select-file-button" type="button" class="btn btn-success">
<span class="icon-copy" aria-hidden="true"></span>
<?php echo $this->text('PLG_INSTALLER_PACKAGEINSTALLER_SELECT_FILE'); ?>
<?php echo Text::_('PLG_INSTALLER_PACKAGEINSTALLER_SELECT_FILE'); ?>
</button>
</p>
<p>
@ -92,7 +92,7 @@ $maxSize = HTMLHelper::_('number.bytes', $maxSizeBytes);
<div id="legacy-uploader" class="hidden">
<div class="control-group">
<label for="install_package" class="control-label"><?php echo $this->text('PLG_INSTALLER_PACKAGEINSTALLER_EXTENSION_PACKAGE_FILE'); ?></label>
<label for="install_package" class="control-label"><?php echo Text::_('PLG_INSTALLER_PACKAGEINSTALLER_EXTENSION_PACKAGE_FILE'); ?></label>
<div class="controls">
<input class="form-control-file" id="install_package" name="install_package" type="file">
<input id="max_upload_size" name="max_upload_size" type="hidden" value="<?php echo $maxSizeBytes; ?>" />
@ -101,7 +101,7 @@ $maxSize = HTMLHelper::_('number.bytes', $maxSizeBytes);
</div>
<div class="form-actions">
<button class="btn btn-primary" type="button" id="installbutton_package">
<?php echo $this->text('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_AND_INSTALL'); ?>
<?php echo Text::_('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_AND_INSTALL'); ?>
</button>
</div>