1
0
mirror of https://github.com/flarum/core.git synced 2025-10-18 02:06:08 +02:00

Rework public API based on events

This commit is contained in:
Toby Zerner
2015-07-18 22:59:47 +09:30
parent 5085c09c30
commit 57650fa648
136 changed files with 1157 additions and 1245 deletions

View File

@@ -1,57 +0,0 @@
<?php namespace Flarum\Extend;
use Illuminate\Contracts\Container\Container;
class Locale implements ExtenderInterface
{
protected $locale;
protected $translations;
protected $config;
protected $js;
public function __construct($locale)
{
$this->locale = $locale;
}
public function translations($translations)
{
$this->translations = $translations;
return $this;
}
public function config($config)
{
$this->config = $config;
return $this;
}
public function js($js)
{
$this->js = $js;
return $this;
}
public function extend(Container $container)
{
$manager = $container->make('flarum.localeManager');
if ($this->translations) {
$manager->addTranslations($this->locale, $this->translations);
}
if ($this->config) {
$manager->addConfig($this->locale, $this->config);
}
if ($this->js) {
$manager->addJsFile($this->locale, $this->js);
}
}
}