1 | <?php |
||
20 | class BaseTranslatedBehavior extends Behavior |
||
21 | { |
||
22 | /** |
||
23 | * @var string the current translate language. If not set, it will use the value of |
||
24 | * [[\yii\base\Application::language]]. |
||
25 | */ |
||
26 | public $language; |
||
27 | /** |
||
28 | * @var string the language that the original messages are in. If not set, it will use the value of |
||
29 | * [[\yii\base\Application::sourceLanguage]]. |
||
30 | */ |
||
31 | public $sourceLanguage; |
||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $_attributes = []; |
||
36 | |||
37 | /** |
||
38 | * Initializes this behavior. |
||
39 | */ |
||
40 | 12 | public function init() |
|
50 | |||
51 | /** |
||
52 | * @return array |
||
53 | */ |
||
54 | 1 | public function getTranslateAttributes() |
|
58 | |||
59 | /** |
||
60 | * @param array $attributes the list of translateAttributes to be translated |
||
61 | */ |
||
62 | 12 | public function setTranslateAttributes($attributes) |
|
70 | |||
71 | /** |
||
72 | * @param string $name |
||
73 | * @return bool |
||
74 | */ |
||
75 | 11 | protected function isAttribute($name) |
|
79 | |||
80 | /** |
||
81 | * @param string $name |
||
82 | * @return string |
||
83 | */ |
||
84 | 6 | protected function getAttributeName($name) |
|
88 | |||
89 | /** |
||
90 | * @return bool |
||
91 | */ |
||
92 | 2 | public function isSourceLanguage() |
|
96 | } |