From 5b0ee7651bf0725d4e3abbe09fdc6a25bf33adcf Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 21 Oct 2020 22:38:09 +0200 Subject: [PATCH] Remove Config dependency on LocaleManager --- classes/Config.php | 16 +++++----------- i18n/template.pot | 42 +++++++++++++++++++++--------------------- templates/info.tpl | 6 ++++++ 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 1a8b5c2..666b741 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -124,7 +124,11 @@ class Config * * @var string[] */ - public $genericFormats = []; + public $genericFormats = [ + 'best/bestvideo' => 'Best', + 'bestvideo+bestaudio' => 'Remux best video with best audio', + 'worst/worstvideo' => 'Worst', + ]; /** * Enable debug mode. @@ -158,16 +162,6 @@ class Config $this->applyOptions($options); $this->getEnv(); $this->validateOptions(); - $localeManager = new LocaleManager(); - - if (empty($this->genericFormats)) { - // We don't put this in the class definition so it can be detected by xgettext. - $this->genericFormats = [ - 'best/bestvideo' => $localeManager->t('Best'), - 'bestvideo+bestaudio' => $localeManager->t('Remux best video with best audio'), - 'worst/worstvideo' => $localeManager->t('Worst'), - ]; - } foreach ($this->genericFormats as $format => $name) { if (strpos($format, '+') !== false) { diff --git a/i18n/template.pot b/i18n/template.pot index 4bbcc14..ae39a4b 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -45,43 +45,55 @@ msgstr "" msgid "Generic formats" msgstr "" +#: templates/info.tpl:35 +msgid "Best" +msgstr "" + #: templates/info.tpl:36 +msgid "Remux best video with best audio" +msgstr "" + +#: templates/info.tpl:37 +msgid "Worst" +msgstr "" + +#: templates/info.tpl:42 msgid "Detailed formats" msgstr "" -#: templates/info.tpl:80 +#: templates/info.tpl:86 msgid "Stream the video through the server" msgstr "" -#: templates/info.tpl:86 +#: templates/info.tpl:92 msgid "Convert into a custom format:" msgstr "" -#: templates/info.tpl:87 +#: templates/info.tpl:93 msgid "Custom format" msgstr "" -#: templates/info.tpl:87 +#: templates/info.tpl:93 msgid "Format to convert to" msgstr "" -#: templates/info.tpl:92 +#: templates/info.tpl:98 msgid "with" msgstr "" -#: templates/info.tpl:93 +#: templates/info.tpl:99 msgid "Bit rate" msgstr "" -#: templates/info.tpl:94 +#: templates/info.tpl:100 msgid "Custom bitrate" msgstr "" -#: templates/info.tpl:97 +#: templates/info.tpl:103 msgid "kbit/s audio" msgstr "" -#: templates/info.tpl:101 templates/playlist.tpl:38 templates/password.tpl:11 +#: templates/info.tpl:107 templates/playlist.tpl:38 templates/password.tpl:11 #: templates/index.tpl:19 msgid "Download" msgstr "" @@ -142,18 +154,6 @@ msgstr "" msgid "Bookmarklet" msgstr "" -#: classes/Config.php:166 -msgid "Best" -msgstr "" - -#: classes/Config.php:167 -msgid "Remux best video with best audio" -msgstr "" - -#: classes/Config.php:168 -msgid "Worst" -msgstr "" - #: classes/Controller/DownloadController.php:64 #: classes/Controller/FrontController.php:166 msgid "Wrong password" diff --git a/templates/info.tpl b/templates/info.tpl index fce119a..3ed51b9 100644 --- a/templates/info.tpl +++ b/templates/info.tpl @@ -30,6 +30,12 @@