Skip to content

Commit

Permalink
Merge pull request #194 from owncloud/always-prepare-parameters
Browse files Browse the repository at this point in the history
Always prepare parameters for extensions
  • Loading branch information
nickvergessen committed Dec 12, 2014
2 parents f6b09d7 + fce36ba commit 35ae9ac
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/datahelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ public function translation($app, $text, $params, $stripPath = false, $highlight
return '';
}

$preparedParams = $this->parameterHelper->prepareParameters(
$params, $this->parameterHelper->getSpecialParameterList($app, $text),
$stripPath, $highlightParams
);

if ($app === 'files') {
$preparedParams = $this->parameterHelper->prepareParameters(
$params, $this->parameterHelper->getSpecialParameterList($app, $text),
$stripPath, $highlightParams
);
switch ($text) {
case 'created_self':
return $this->l->t('You created %1$s', $preparedParams);
Expand Down Expand Up @@ -96,14 +97,14 @@ public function translation($app, $text, $params, $stripPath = false, $highlight

// Allow other apps to correctly translate their activities
$translation = $this->activityManager->translate(
$app, $text, $params, $stripPath, $highlightParams, $this->l->getLanguageCode());
$app, $text, $preparedParams, $stripPath, $highlightParams, $this->l->getLanguageCode());

if ($translation !== false) {
return $translation;
}

$l = Util::getL10N($app);
return $l->t($text, $params);
return $l->t($text, $preparedParams);
}

/**
Expand Down

0 comments on commit 35ae9ac

Please sign in to comment.