Add support for variables in translation (#250)

This commit is contained in:
Pierre Rudloff 2019-11-29 21:33:49 +01:00
parent 6fb1cbaa6c
commit 850fc80622
8 changed files with 145 additions and 101 deletions

View file

@ -167,11 +167,19 @@ class FrontController extends BaseController
$template = 'info.tpl';
}
$title = $this->localeManager->t('Video download');
$description = $this->localeManager->t('Download video from ') . $this->video->extractor_key;
$description = $this->localeManager->t(
'Download video from @extractor',
['@extractor' => $this->video->extractor_key]
);
if (isset($this->video->title)) {
$title = $this->video->title;
$description = $this->localeManager->t('Download') . ' "' . $this->video->title . '" ' .
$this->localeManager->t('from') . ' ' . $this->video->extractor_key;
$description = $this->localeManager->t(
'Download @title from @extractor',
[
'@title' => $this->video->title,
'@extractor' => $this->video->extractor_key
]
);
}
$this->view->render(
$response,