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