| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 91 | public function trans( |
||
| 92 | string $keyToTranslate, |
||
| 93 | array $arguments = [], |
||
| 94 | string $fallback = null, |
||
| 95 | string $locale = null |
||
| 96 | ): string { |
||
| 97 | $locale = $locale ?? $this->locale; |
||
| 98 | |||
| 99 | $replaced = sprintf( |
||
| 100 | $this->bookmark->getCatalogue($locale)->getByKey($keyToTranslate), |
||
| 101 | ...$arguments |
||
| 102 | ); |
||
| 103 | |||
| 104 | if (empty($replaced)) { |
||
| 105 | return $fallback; |
||
| 106 | } |
||
| 107 | |||
| 108 | return $replaced; |
||
| 109 | } |
||
| 111 |