forked from luyadev/luya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
55 lines (49 loc) · 1.41 KB
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace luya;
use Yii;
use luya\components\UrlRule;
class Module extends \luya\base\Module
{
/**
* The current luya version.
*
* @link https://github.com/zephir/luya/blob/master/CHANGELOG.md
*
* @var string
*/
const VERSION = '1.0.0-beta5-dev';
/**
* Default url behavior if luya is included. first rule which will be picked.
*
* @var array
*/
public $urlRules = [
['class' => 'luya\components\UrlRule', 'position' => UrlRule::POSITION_LUYA],
];
/**
* @var array Register all luya core component language messages.
*/
public $translations = [
[
'prefix' => 'luya*',
'basePath' => '@luya/messages',
'fileMap' => [
'luya/luya' => 'luya.php',
'luya/admin' => 'admin.php',
'luya/cmsadmin' => 'cmsadmin.php',
],
],
];
/**
* Get translations for a speficif section
*
* @param string $category The categery of the translation, e.g. 'admin' (cause fileMap luya/admin)
* @param string $message The message name (array key in messages file)
* @param array $params Optional paramters to pass.
* @return string
*/
public static function t($category, $message, array $params = [])
{
return Yii::t('luya/' . $category, $message, $params, Yii::$app->luyaLanguage);
}
}