Fix L10N::t

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-07-24 11:36:20 +02:00
parent fd465d4e49
commit ede15f0988
No known key found for this signature in database
GPG Key ID: F941078878347C0C
9 changed files with 20 additions and 20 deletions

View File

@ -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]);
}
}

View File

@ -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(),

View File

@ -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.',

View File

@ -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']);

View File

@ -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;

View File

@ -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();

View File

@ -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));

View File

@ -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.')
);

View File

@ -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])
);
}