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