You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
502 B
25 lines
502 B
<?php |
|
/** |
|
* Created by Error202 |
|
* Date: 18.08.2018 |
|
*/ |
|
|
|
namespace core\helpers; |
|
|
|
use yii\helpers\ArrayHelper; |
|
use Yii; |
|
|
|
class ModuleHelper |
|
{ |
|
// add module translation without load module |
|
public static function addModuleAdminTranslation($module_name) |
|
{ |
|
Yii::$app->getI18n()->translations = ArrayHelper::merge(Yii::$app->getI18n()->translations, [ |
|
$module_name => [ |
|
'class' => 'yii\i18n\PhpMessageSource', |
|
'basePath' => '@common/modules/' . $module_name . '/messages', |
|
], |
|
]); |
|
} |
|
|
|
} |