From ede15f0988c02cf65f9d1a763d9bb2ea0edde2e9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 24 Jul 2017 11:36:20 +0200 Subject: [PATCH] Fix L10N::t Signed-off-by: Roeland Jago Douma --- apps/files_external/lib/config.php | 6 +++--- apps/updatenotification/lib/Notification/Notifier.php | 2 +- apps/user_ldap/lib/Notification/Notifier.php | 4 ++-- apps/workflowengine/lib/Manager.php | 10 +++++----- lib/private/App/DependencyAnalyzer.php | 8 ++++---- .../AppFramework/DependencyInjection/DIContainer.php | 2 +- lib/private/AppFramework/Http/Request.php | 2 +- lib/private/Setup.php | 4 ++-- lib/private/Tags.php | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 7a10d4bbc2..4900de57b6 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -313,11 +313,11 @@ class OC_Mount_Config { private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) { switch (strtolower($module)) { case 'curl': - return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend); + return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); case 'ftp': - return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend); + return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); default: - return (string)$l->t('"%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', array($module, $backend)); + return (string)$l->t('"%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$module, $backend]); } } diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php index e512825da0..2fc1d36b0c 100644 --- a/apps/updatenotification/lib/Notification/Notifier.php +++ b/apps/updatenotification/lib/Notification/Notifier.php @@ -117,7 +117,7 @@ class Notifier implements INotifier { } $notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()])) - ->setRichSubject($l->t('Update for {app} to version %s is available.', $notification->getObjectId()), [ + ->setRichSubject($l->t('Update for {app} to version %s is available.', [$notification->getObjectId()]), [ 'app' => [ 'type' => 'app', 'id' => $notification->getObjectType(), diff --git a/apps/user_ldap/lib/Notification/Notifier.php b/apps/user_ldap/lib/Notification/Notifier.php index 0099d764f0..795d8d4c34 100644 --- a/apps/user_ldap/lib/Notification/Notifier.php +++ b/apps/user_ldap/lib/Notification/Notifier.php @@ -63,9 +63,9 @@ class Notifier implements INotifier { $params = $notification->getSubjectParameters(); $days = (int) $params[0]; if ($days === 2) { - $notification->setParsedSubject($l->t('Your password will expire tomorrow.', $days)); + $notification->setParsedSubject($l->t('Your password will expire tomorrow.')); } else if ($days === 1) { - $notification->setParsedSubject($l->t('Your password will expire today.', $days)); + $notification->setParsedSubject($l->t('Your password will expire today.')); } else { $notification->setParsedSubject($l->n( 'Your password will expire within %n day.', diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index e93498b507..48d29cf207 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -165,7 +165,7 @@ class Manager implements IManager { return $row; } - throw new \UnexpectedValueException($this->l->t('Operation #%s does not exist', $id)); + throw new \UnexpectedValueException($this->l->t('Operation #%s does not exist', [$id])); } /** @@ -250,11 +250,11 @@ class Manager implements IManager { /** @var IOperation $instance */ $instance = $this->container->query($class); } catch (QueryException $e) { - throw new \UnexpectedValueException($this->l->t('Operation %s does not exist', $class)); + throw new \UnexpectedValueException($this->l->t('Operation %s does not exist', [$class])); } if (!($instance instanceof IOperation)) { - throw new \UnexpectedValueException($this->l->t('Operation %s is invalid', $class)); + throw new \UnexpectedValueException($this->l->t('Operation %s is invalid', [$class])); } $instance->validateOperation($name, $checks, $operation); @@ -264,11 +264,11 @@ class Manager implements IManager { /** @var ICheck $instance */ $instance = $this->container->query($check['class']); } catch (QueryException $e) { - throw new \UnexpectedValueException($this->l->t('Check %s does not exist', $class)); + throw new \UnexpectedValueException($this->l->t('Check %s does not exist', [$class])); } if (!($instance instanceof ICheck)) { - throw new \UnexpectedValueException($this->l->t('Check %s is invalid', $class)); + throw new \UnexpectedValueException($this->l->t('Check %s is invalid', [$class])); } $instance->validateCheck($check['operator'], $check['value']); diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php index 1ec028b972..4e998c71f3 100644 --- a/lib/private/App/DependencyAnalyzer.php +++ b/lib/private/App/DependencyAnalyzer.php @@ -179,7 +179,7 @@ class DependencyAnalyzer { }, $supportedDatabases); $currentDatabase = $this->platform->getDatabase(); if (!in_array($currentDatabase, $supportedDatabases)) { - $missing[] = (string)$this->l->t('Following databases are supported: %s', implode(', ', $supportedDatabases)); + $missing[] = (string)$this->l->t('Following databases are supported: %s', [implode(', ', $supportedDatabases)]); } return $missing; } @@ -282,7 +282,7 @@ class DependencyAnalyzer { } $currentOS = $this->platform->getOS(); if (!in_array($currentOS, $oss)) { - $missing[] = (string)$this->l->t('Following platforms are supported: %s', implode(', ', $oss)); + $missing[] = (string)$this->l->t('Following platforms are supported: %s', [implode(', ', $oss)]); } return $missing; } @@ -315,12 +315,12 @@ class DependencyAnalyzer { if (!is_null($minVersion)) { if ($this->compareSmaller($this->platform->getOcVersion(), $minVersion)) { - $missing[] = (string)$this->l->t('Server version %s or higher is required.', $this->toVisibleVersion($minVersion)); + $missing[] = (string)$this->l->t('Server version %s or higher is required.', [$this->toVisibleVersion($minVersion)]); } } if (!is_null($maxVersion)) { if ($this->compareBigger($this->platform->getOcVersion(), $maxVersion)) { - $missing[] = (string)$this->l->t('Server version %s or lower is required.', $this->toVisibleVersion($maxVersion)); + $missing[] = (string)$this->l->t('Server version %s or lower is required.', [$this->toVisibleVersion($maxVersion)]); } } return $missing; diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index b233f3ca9b..d0c69c3bf3 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -75,7 +75,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * Put your class dependencies in here * @param string $appName the name of the app * @param array $urlParams - * @param ServerContainer $server + * @param ServerContainer|null $server */ public function __construct($appName, $urlParams = array(), ServerContainer $server = null){ parent::__construct(); diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 09e18f7417..956744e5d5 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -721,7 +721,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { // strip off the script name's dir and file name // FIXME: Sabre does not really belong here - list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($scriptName); + list($path, $name) = \Sabre\Uri\split($scriptName); if (!empty($path)) { if($path === $pathInfo || strpos($pathInfo, $path.'/') === 0) { $pathInfo = substr($pathInfo, strlen($path)); diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 1e98ed5456..521a8f75f8 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -223,7 +223,7 @@ class Setup { 'error' => $this->l10n->t( 'Mac OS X is not supported and %s will not work properly on this platform. ' . 'Use it at your own risk! ', - $this->defaults->getName() + [$this->defaults->getName()] ), 'hint' => $this->l10n->t('For the best results, please consider using a GNU/Linux server instead.') ); @@ -234,7 +234,7 @@ class Setup { 'error' => $this->l10n->t( 'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' . 'This will lead to problems with files over 4 GB and is highly discouraged.', - $this->defaults->getName() + [$this->defaults->getName()] ), 'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP.') ); diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 3ec1af00e3..b63435ff83 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -274,7 +274,7 @@ class Tags implements \OCP\ITags { if($tagId === false) { $l10n = \OC::$server->getL10N('core'); throw new \Exception( - $l10n->t('Could not find category "%s"', $tag) + $l10n->t('Could not find category "%s"', [$tag]) ); }