Update localization
This commit is contained in:
parent
83567a4087
commit
1b071ef37e
|
@ -80,7 +80,7 @@ class Plugin extends PluginBase
|
||||||
return [
|
return [
|
||||||
'settings' => [
|
'settings' => [
|
||||||
'label' => 'Adrema',
|
'label' => 'Adrema',
|
||||||
'description' => 'setting_description',
|
'description' => 'silva.adrema::lang.setting_description',
|
||||||
'category' => 'CATEGORY_CMS',
|
'category' => 'CATEGORY_CMS',
|
||||||
'icon' => 'icon-cog',
|
'icon' => 'icon-cog',
|
||||||
'class' => Settings::class,
|
'class' => Settings::class,
|
||||||
|
|
|
@ -26,8 +26,8 @@ abstract class EventManager extends ComponentBase
|
||||||
$componentName = str(class_basename(static::class))->snake();
|
$componentName = str(class_basename(static::class))->snake();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'name' => __("{$componentName}_component_name"),
|
'name' => __("silva.adrema::lang.{$componentName}_component_name"),
|
||||||
'description' => __("{$componentName}_component_description"),
|
'description' => __("silva.adrema::lang.{$componentName}_component_description"),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,22 +68,22 @@ abstract class EventManager extends ComponentBase
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'indexPage' => [
|
'indexPage' => [
|
||||||
'title' => __('properties.index_page_title'),
|
'title' => __('silva.adrema::lang.properties.index_page_title'),
|
||||||
'type' => 'dropdown',
|
'type' => 'dropdown',
|
||||||
'default' => null,
|
'default' => null,
|
||||||
],
|
],
|
||||||
'singlePage' => [
|
'singlePage' => [
|
||||||
'title' => __('properties.single_page_title'),
|
'title' => __('silva.adrema::lang.properties.single_page_title'),
|
||||||
'type' => 'dropdown',
|
'type' => 'dropdown',
|
||||||
'default' => null,
|
'default' => null,
|
||||||
],
|
],
|
||||||
'registerPage' => [
|
'registerPage' => [
|
||||||
'title' => __('properties.register_page_title'),
|
'title' => __('silva.adrema::lang.properties.register_page_title'),
|
||||||
'type' => 'dropdown',
|
'type' => 'dropdown',
|
||||||
'default' => null,
|
'default' => null,
|
||||||
],
|
],
|
||||||
'eventSlug' => [
|
'eventSlug' => [
|
||||||
'title' => __('properties.event_slug_title'),
|
'title' => __('silva.adrema::lang.properties.event_slug_title'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'default' => null,
|
'default' => null,
|
||||||
],
|
],
|
||||||
|
@ -114,10 +114,10 @@ abstract class EventManager extends ComponentBase
|
||||||
|
|
||||||
private function getPageFromProperty(string $property): Page
|
private function getPageFromProperty(string $property): Page
|
||||||
{
|
{
|
||||||
throw_if(!$this->property('indexPage') || !$this->property('singlePage') || !$this->property('registerPage'), ComponentException::class, 'not_all_pages_set');
|
throw_if(!$this->property('indexPage') || !$this->property('singlePage') || !$this->property('registerPage'), ComponentException::class, 'silva.adrema::lang.not_all_pages_set');
|
||||||
|
|
||||||
$page = Page::find($this->property($property));
|
$page = Page::find($this->property($property));
|
||||||
throw_if($page === null, ComponentException::class, 'page_not_found');
|
throw_if($page === null, ComponentException::class, 'silva.adrema::lang.page_not_found');
|
||||||
|
|
||||||
return $page;
|
return $page;
|
||||||
}
|
}
|
||||||
|
@ -131,8 +131,8 @@ abstract class EventManager extends ComponentBase
|
||||||
$singlePage = $this->getPageFromProperty('singlePage');
|
$singlePage = $this->getPageFromProperty('singlePage');
|
||||||
$registerPage = $this->getPageFromProperty('registerPage');
|
$registerPage = $this->getPageFromProperty('registerPage');
|
||||||
|
|
||||||
throw_if(!str($singlePage->url)->contains(':slug'), ComponentException::class, 'slug_not_found');
|
throw_if(!str($singlePage->url)->contains(':slug'), ComponentException::class, 'silva.adrema::lang.slug_not_found');
|
||||||
throw_if(!str($registerPage->url)->contains(':slug'), ComponentException::class, 'slug_not_found');
|
throw_if(!str($registerPage->url)->contains(':slug'), ComponentException::class, 'silva.adrema::lang.slug_not_found');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'indexUrl' => $indexPage->url,
|
'indexUrl' => $indexPage->url,
|
||||||
|
|
|
@ -7,7 +7,7 @@ class FetchSingleEvent
|
||||||
public function run(string $slug): ?array
|
public function run(string $slug): ?array
|
||||||
{
|
{
|
||||||
$events = data_get(app(FetchAllEvents::class)->run(), 'data');
|
$events = data_get(app(FetchAllEvents::class)->run(), 'data');
|
||||||
throw_if(is_null($events), ComponentException::class, 'event_fetching_failed');
|
throw_if(is_null($events), ComponentException::class, 'silva.adrema::lang.event_fetching_failed');
|
||||||
|
|
||||||
return collect($events)->first(fn ($event) => $event['slug'] === $slug);
|
return collect($events)->first(fn ($event) => $event['slug'] === $slug);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue