1 | <?php |
||
21 | class BaseTranslatedBehavior extends Behavior |
||
22 | { |
||
23 | /** |
||
24 | * @var string the current translate language. If not set, it will use the value of |
||
25 | * [[\yii\base\Application::language]]. |
||
26 | */ |
||
27 | public $language; |
||
28 | /** |
||
29 | * @var string the language that the original messages are in. If not set, it will use the value of |
||
30 | * [[\yii\base\Application::sourceLanguage]]. |
||
31 | */ |
||
32 | public $sourceLanguage; |
||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $_attributes = []; |
||
37 | |||
38 | /** |
||
39 | * Initializes this behavior. |
||
40 | */ |
||
41 | 14 | public function init() |
|
51 | |||
52 | /** |
||
53 | * @param string $locale `en-EN`, `ru-RU` |
||
54 | * @return string |
||
55 | 1 | */ |
|
56 | private function getPrimaryLanguage($locale) |
||
61 | |||
62 | /** |
||
63 | 14 | * @return array |
|
64 | */ |
||
65 | 14 | public function getTranslateAttributes() |
|
69 | 14 | ||
70 | 14 | /** |
|
71 | * @param array $attributes the list of translateAttributes to be translated |
||
72 | */ |
||
73 | public function setTranslateAttributes($attributes) |
||
81 | |||
82 | /** |
||
83 | * @param string $name |
||
84 | * @return bool |
||
85 | 9 | */ |
|
86 | protected function isAttribute($name) |
||
90 | |||
91 | /** |
||
92 | * @param string $name |
||
93 | 2 | * @return string |
|
94 | */ |
||
95 | 2 | public function getTranslateAttributeName($name) |
|
99 | |||
100 | /** |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function isSourceLanguage() |
||
107 | } |