mirror of
https://github.com/flarum/core.git
synced 2025-01-18 06:38:25 +01:00
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:
parent
7fd23ff950
commit
b46d5e67a3
@ -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}
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user