Make Translator compatible with Laravel 6

It's contract will change in Laravel 6. We extend from Symfony's
translator, but need to be compatible with that from Laravel in
order to use its validation package.

References:
- https://laravel.com/docs/6.x/upgrade#trans-and-trans-choice
- 8557dc56b1 (diff-88bc04a1548d09aa6250d902d1ac2b4c)
This commit is contained in:
Franz Liedke 2020-07-24 17:32:50 +02:00
parent 8a7e70550e
commit bf774d8a9b

@ -17,6 +17,16 @@ class Translator extends BaseTranslator implements TranslatorContract
{
const REFERENCE_REGEX = '/^=>\s*([a-z0-9_\-\.]+)$/i';
public function get($key, array $replace = [], $locale = null)
{
return $this->trans($key, $replace, null, $locale);
}
public function choice($key, $number, array $replace = [], $locale = null)
{
return $this->transChoice($key, $number, $replace, nil, $locale);
}
/**
* {@inheritdoc}
*/