1
0
mirror of https://github.com/flarum/core.git synced 2025-05-05 15:07:17 +02:00

applied laravel contract

This commit is contained in:
Daniel Klabbers 2017-11-27 09:49:19 +01:00
parent 0b1043c9d2
commit e2d61d1aeb
2 changed files with 7 additions and 6 deletions

View File

@ -14,11 +14,10 @@ namespace Flarum\Locale;
use Flarum\Event\ConfigureLocales;
use Flarum\Foundation\AbstractServiceProvider;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Translation\Translator;
use Illuminate\Translation\FileLoader;
//use Symfony\Component\Translation\MessageSelector;
//use Symfony\Component\Translation\Translator;
//use Symfony\Component\Translation\TranslatorInterface;
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\TranslatorInterface;
class LocaleServiceProvider extends AbstractServiceProvider
{
@ -53,6 +52,7 @@ class LocaleServiceProvider extends AbstractServiceProvider
});
$this->app->alias('translator', Translator::class);
$this->app->alias('translator', TranslatorInterface::class);
$this->app->alias('translator', TranslatorContract::class);
}
private function getDefaultLocale()

View File

@ -13,8 +13,9 @@ namespace Flarum\Locale;
use Symfony\Component\Translation\MessageCatalogueInterface;
use Symfony\Component\Translation\Translator as BaseTranslator;
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
class Translator extends BaseTranslator
class Translator extends BaseTranslator implements TranslatorContract
{
const REFERENCE_REGEX = '/^=>\s*([a-z0-9_\-\.]+)$/i';