Class yii\bootstrap5\i18n\TranslationBootstrap

Inheritanceyii\bootstrap5\i18n\TranslationBootstrap
Implementsyii\base\BootstrapInterface
Source Code https://github.com/yiisoft/yii2-bootstrap5/blob/master/src/i18n/TranslationBootstrap.php

This bootstrap implementation is used to add translations automatically to application configuration.

Public Methods

Hide inherited methods

Method Description Defined By
bootstrap() yii\bootstrap5\i18n\TranslationBootstrap

Method Details

Hide inherited methods

bootstrap() public method

public void bootstrap ( mixed $app )
$app mixed

                public function bootstrap($app): void
{
    $app->getI18n()->translations['yii/bootstrap5'] = [
        'class' => GettextMessageSource::class,
        'sourceLanguage' => 'en-US',
        'basePath' => '@yii/bootstrap5/messages',
    ];
}