mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 19:01:55 +08: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
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}
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user