| Total Complexity | 3 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Module extends BaseModule |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @inheritdoc |
||
| 12 | */ |
||
| 13 | public $controllerNamespace = 'graychen/yii2/basic/auth/controllers'; |
||
| 14 | /** |
||
| 15 | * |
||
| 16 | * @var string source language for translation |
||
| 17 | */ |
||
| 18 | public $sourceLanguage = 'en-US'; |
||
| 19 | /** |
||
| 20 | * @inheritdoc |
||
| 21 | */ |
||
| 22 | public function init() |
||
| 26 | } |
||
| 27 | /** |
||
| 28 | * Registers the translation files |
||
| 29 | */ |
||
| 30 | protected function registerTranslations() |
||
| 31 | { |
||
| 32 | Yii::$app->i18n->translations['graychen/yii2/basic/auth/*'] = [ |
||
|
|
|||
| 33 | 'class' => 'yii\i18n\PhpMessageSource', |
||
| 34 | 'sourceLanguage' => $this->sourceLanguage, |
||
| 35 | 'basePath' => '@graychen/yii2/basic/auth/messages', |
||
| 36 | 'fileMap' => [ |
||
| 37 | 'graychen/yii2/basic/auth/app.php' => 'app.php', |
||
| 38 | ], |
||
| 39 | ]; |
||
| 40 | } |
||
| 41 | /** |
||
| 42 | * Translates a message. This is just a wrapper of Yii::t |
||
| 43 | * |
||
| 44 | * @see Yii::t |
||
| 45 | * |
||
| 46 | * @param $category |
||
| 47 | * @param $message |
||
| 48 | * @param array $params |
||
| 49 | * @param null $language |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public static function t($category, $message, $params = [], $language = null) |
||
| 55 | } |
||
| 56 | } |
||
| 57 |