| 1 | <?php |
||
| 12 | class Locale implements ServiceTranslationProvider |
||
| 13 | { |
||
| 14 | |||
| 15 | const DOMAIN = 'messages'; |
||
| 16 | const LANG_DIR = ROOT . '/cache/lang/'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string[] |
||
| 20 | */ |
||
| 21 | private $locales; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @Inject({ |
||
| 25 | * "%locales%", |
||
| 26 | * "%application.defaultLocale%" |
||
| 27 | * }); |
||
| 28 | * @param string[] $locales |
||
| 29 | * @param string $defaultLocale |
||
| 30 | */ |
||
| 31 | 2 | public function __construct(array $locales, string $defaultLocale = '') |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @return string[] |
||
| 42 | */ |
||
| 43 | 1 | public function getLocales() : array |
|
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $locale |
||
| 50 | * @codeCoverageIgnore |
||
| 51 | */ |
||
| 52 | public function setLocale(string $locale) : void |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return string[] |
||
| 64 | */ |
||
| 65 | public function getTokens() |
||
| 71 | } |
||
| 72 |