yii2-bootstrap5/src/i18n/TranslationBootstrap.php

32 lines
778 B
PHP
Raw Normal View History

<?php
/**
2022-10-12 14:24:59 +08:00
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\bootstrap5\i18n;
2022-10-12 14:24:59 +08:00
use yii\base\BootstrapInterface;
use yii\i18n\GettextMessageSource;
/**
2022-10-12 14:24:59 +08:00
* This bootstrap implementation is used to add translations automatically to application configuration.
*
* @author Simon Karlen <simi.albi@gmail.com>
*/
2022-10-12 14:24:59 +08:00
class TranslationBootstrap implements BootstrapInterface
{
/**
2022-10-12 14:24:59 +08:00
* @inheritDoc
*/
public function bootstrap($app)
{
2022-10-12 14:24:59 +08:00
$app->getI18n()->translations['yii/bootstrap5'] = [
'class' => GettextMessageSource::class,
'sourceLanguage' => 'en-US',
'basePath' => '@yii/bootstrap5/messages'
];
}
}