diff --git a/libraries/src/Plugin/CMSPlugin.php b/libraries/src/Plugin/CMSPlugin.php index 4ce165278749e..cefcff161971d 100644 --- a/libraries/src/Plugin/CMSPlugin.php +++ b/libraries/src/Plugin/CMSPlugin.php @@ -384,4 +384,22 @@ public function setApplication(CMSApplicationInterface $application): void $this->setLanguage($application->getLanguage()); } } + + /** + * Returns the string for the given key from the internal language object. + * + * @param string $key The key + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + protected function text(string $key): string + { + try { + return $this->getLanguage()->_($key); + } catch (\UnexpectedValueException $e) { + return $this->getApplication()->getLanguage()->_($key); + } + } } diff --git a/plugins/installer/packageinstaller/tmpl/default.php b/plugins/installer/packageinstaller/tmpl/default.php index 570673f76a950..627a4c795429a 100644 --- a/plugins/installer/packageinstaller/tmpl/default.php +++ b/plugins/installer/packageinstaller/tmpl/default.php @@ -37,7 +37,7 @@ $maxSizeBytes = FilesystemHelper::fileUploadMaxSize(false); $maxSize = HTMLHelper::_('number.bytes', $maxSizeBytes); ?> - +text('PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_INSTALL_JOOMLA_EXTENSION'); ?>
@@ -57,7 +57,7 @@

- + text('PLG_INSTALLER_PACKAGEINSTALLER_UPLOADING'); ?> 0%

@@ -68,18 +68,18 @@

- + text('PLG_INSTALLER_PACKAGEINSTALLER_INSTALLING'); ?>

- + text('PLG_INSTALLER_PACKAGEINSTALLER_DRAG_FILE_HERE'); ?>

@@ -92,7 +92,7 @@