| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | public function translate(string $key, $value = []) :string |
||
| 59 | { |
||
| 60 | if (empty($this->translation)) { |
||
| 61 | return $key; |
||
| 62 | } |
||
| 63 | |||
| 64 | if (empty($this->translation[$this->language][$key])) { |
||
| 65 | return $key; |
||
| 66 | } |
||
| 67 | |||
| 68 | if (!empty($value)) { |
||
| 69 | return vsprintf($this->translation[$this->language][$key], $value); |
||
| 70 | } |
||
| 71 | |||
| 72 | return $this->translation[$this->language][$key]; |
||
| 73 | } |
||
| 74 | |||
| 75 | } |