| 1 | <?php |
||
| 17 | class FineCascadingTranslator implements TranslatorInterface |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * List of all translator in order of priority |
||
| 21 | * |
||
| 22 | * @var array<\Mouf\Utils\I18n\Fine\TranslatorInterface> |
||
| 23 | */ |
||
| 24 | private $translators = array(); |
||
| 25 | |||
| 26 | /** |
||
| 27 | * |
||
| 28 | * @param array<\Mouf\Utils\I18n\Fine\TranslatorInterface> $translators |
||
| 29 | */ |
||
| 30 | public function __construct(array $translators = array()) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Check all translators to retrieve message in the order. When there is one translation, the function return the message (of the first found). |
||
| 37 | * If the message doesn't exist return null |
||
| 38 | * |
||
| 39 | * @param $message string This is the key of translation search |
||
| 40 | * @param $parameters array All parameters to customize message |
||
| 41 | * @param LanguageDetectionInterface $languageDetection Set it if you want to force the language to another value |
||
| 42 | * @return string|null |
||
| 43 | */ |
||
| 44 | public function getTranslation($message, array $parameters = array(), LanguageDetectionInterface $languageDetection = null) |
||
| 55 | } |
||
| 56 |