From 9e944cd085f5863e46ec93db48b6fdc6a9e0260f Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 12 Oct 2022 09:24:59 +0300 Subject: [PATCH] Normalize TranslationBootstrap (#53) --- src/i18n/TranslationBootstrap.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/i18n/TranslationBootstrap.php b/src/i18n/TranslationBootstrap.php index 8a667c4..79fa83a 100644 --- a/src/i18n/TranslationBootstrap.php +++ b/src/i18n/TranslationBootstrap.php @@ -1,25 +1,29 @@ + * @link https://www.yiiframework.com/ + * @copyright Copyright (c) 2008 Yii Software LLC + * @license https://www.yiiframework.com/license/ */ namespace yii\bootstrap5\i18n; -use yii\base\Application; +use yii\base\BootstrapInterface; +use yii\i18n\GettextMessageSource; /** - * This bootstrap implementation is used to add translations automatically to app configuration + * This bootstrap implementation is used to add translations automatically to application configuration. + * + * @author Simon Karlen */ -class TranslationBootstrap implements \yii\base\BootstrapInterface +class TranslationBootstrap implements BootstrapInterface { /** - * {@inheritDoc} + * @inheritDoc */ public function bootstrap($app) { - $app->i18n->translations['yii/bootstrap5*'] = [ - 'class' => '\yii\i18n\GettextMessageSource', + $app->getI18n()->translations['yii/bootstrap5'] = [ + 'class' => GettextMessageSource::class, 'sourceLanguage' => 'en-US', 'basePath' => '@yii/bootstrap5/messages' ];