mirror of
https://github.com/flarum/core.git
synced 2025-07-12 20:36:28 +02: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:
@ -17,6 +17,16 @@ class Translator extends BaseTranslator implements TranslatorContract
|
|||||||
{
|
{
|
||||||
const REFERENCE_REGEX = '/^=>\s*([a-z0-9_\-\.]+)$/i';
|
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}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user