1 | <?php |
||
22 | class BaseTranslatedBehavior extends Behavior |
||
23 | { |
||
24 | use LocaleHelperTrait; |
||
25 | /** |
||
26 | * @var string the current translate language. If not set, it will use the value of |
||
27 | * [[\yii\base\Application::language]]. |
||
28 | */ |
||
29 | private $language; |
||
30 | /** |
||
31 | * @var string the language that the original messages are in. If not set, it will use the value of |
||
32 | * [[\yii\base\Application::sourceLanguage]]. |
||
33 | */ |
||
34 | private $sourceLanguage; |
||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $attributes = []; |
||
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | 13 | public function getLanguage() |
|
50 | |||
51 | /** |
||
52 | * @param string $locale |
||
53 | */ |
||
54 | 13 | public function setLanguage($locale) |
|
58 | |||
59 | /** |
||
60 | * @return string |
||
61 | */ |
||
62 | 13 | public function getSourceLanguage() |
|
69 | |||
70 | /** |
||
71 | * @param string $locale |
||
72 | */ |
||
73 | 13 | public function setSourceLanguage($locale) |
|
77 | |||
78 | /** |
||
79 | * @return array |
||
80 | */ |
||
81 | 1 | public function getTranslateAttributes() |
|
85 | |||
86 | /** |
||
87 | * @param array $attributes the list of translateAttributes to be translated |
||
88 | */ |
||
89 | 17 | public function setTranslateAttributes(array $attributes) |
|
97 | |||
98 | /** |
||
99 | * @param string $name |
||
100 | * @return bool |
||
101 | */ |
||
102 | 15 | protected function isAttribute($name) |
|
106 | |||
107 | /** |
||
108 | * @param string $name |
||
109 | * @return string |
||
110 | */ |
||
111 | 11 | public function getTranslateAttributeName($name) |
|
115 | |||
116 | /** |
||
117 | * @return bool |
||
118 | */ |
||
119 | 2 | public function isSourceLanguage() |
|
123 | } |