Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Domain\Translation\Service; |
| 6 | |
| 7 | interface TranslatorInterface |
| 8 | { |
| 9 | /** |
| 10 | * Translates a message key according to the multi-layered fallback strategy. |
| 11 | * |
| 12 | * @param string $key Message key to translate (e.g. 'host_management') |
| 13 | * @param string $category Translation category/module (e.g. 'menu', 'host', 'global') |
| 14 | * @param string|null $locale Target locale ('en', 'pl'). Null defaults to request/system locale. |
| 15 | * @return string Translated string or key fallback |
| 16 | */ |
| 17 | public function translate(string $key, string $category = 'global', ?string $locale = null): string; |
| 18 | |
| 19 | /** |
| 20 | * Sets the active locale for the current request. |
| 21 | */ |
| 22 | public function setLocale(string $locale): void; |
| 23 | |
| 24 | /** |
| 25 | * Gets the active locale for the current request. |
| 26 | */ |
| 27 | public function getLocale(): string; |
| 28 | } |