1
0
mirror of https://github.com/flarum/core.git synced 2025-10-28 22:07:33 +01:00

Decouple from Laravel, implement translator

This commit is contained in:
Toby Zerner
2015-08-12 18:33:39 +09:30
parent 9f0358bb39
commit 47595ff9c4
6 changed files with 1133 additions and 74 deletions

View File

@@ -34,5 +34,11 @@ class LocaleServiceProvider extends ServiceProvider
$this->app->singleton('Flarum\Locale\LocaleManager');
$this->app->alias('Flarum\Locale\LocaleManager', 'flarum.localeManager');
$this->app->bind('translator', function ($app) {
$locales = $app->make('flarum.localeManager');
return new Translator($locales->getTranslations('en'), $locales->getConfig('en')['plural']);
});
}
}