From 7ae49eacd4ea6dede11ba6eb99a835ee9ab29e4e Mon Sep 17 00:00:00 2001 From: SWEETIS Date: Tue, 18 Jul 2023 15:05:15 +0300 Subject: [PATCH] style(Localization): Change function trans --- .../Resources/SettingGroupResource.php | 16 ++++++++-------- src/MoonShine/Resources/SettingResource.php | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/MoonShine/Resources/SettingGroupResource.php b/src/MoonShine/Resources/SettingGroupResource.php index 1ed921e..3f366d6 100644 --- a/src/MoonShine/Resources/SettingGroupResource.php +++ b/src/MoonShine/Resources/SettingGroupResource.php @@ -24,40 +24,40 @@ class SettingGroupResource extends Resource public function title(): string { - return __('laravel-site-settings::ui.settings_groups'); + return trans('laravel-site-settings::ui.settings_groups'); } public function fields(): array { return [ - Block::make(__('laravel-site-settings::ui.main'), [ + Block::make(trans('laravel-site-settings::ui.main'), [ ID::make()->sortable(), - Text::make(__('laravel-site-settings::ui.slug'), 'slug') + Text::make(trans('laravel-site-settings::ui.slug'), 'slug') ->required() ->sortable() ->hint('a-z, 0-9, -, _') ->showOnExport(), - Text::make(__('laravel-site-settings::ui.hint'), 'hint') + Text::make(trans('laravel-site-settings::ui.hint'), 'hint') ->nullable() ->sortable() - ->hint(__('laravel-site-settings::ui.not_used')) + ->hint(trans('laravel-site-settings::ui.not_used')) ->showOnExport(), - NoInput::make(__('laravel-site-settings::ui.created_at'), 'created_at', + NoInput::make(trans('laravel-site-settings::ui.created_at'), 'created_at', fn(SettingGroup $item)=>$item->created_at->isoFormat('lll')) ->sortable() ->hideOnForm() ->showOnExport(), - NoInput::make(__('laravel-site-settings::ui.updated_at'), 'updated_at', + NoInput::make(trans('laravel-site-settings::ui.updated_at'), 'updated_at', fn(SettingGroup $item)=>$item->updated_at->isoFormat('lll')) ->sortable() ->hideOnForm() ->showOnExport(), - NoInput::make(__('laravel-site-settings::ui.count_settings'), 'settings_count') + NoInput::make(trans('laravel-site-settings::ui.count_settings'), 'settings_count') ->sortable() ->hideOnForm() ->hideOnDetail() diff --git a/src/MoonShine/Resources/SettingResource.php b/src/MoonShine/Resources/SettingResource.php index 22cea3d..b976c23 100644 --- a/src/MoonShine/Resources/SettingResource.php +++ b/src/MoonShine/Resources/SettingResource.php @@ -27,17 +27,17 @@ class SettingResource extends Resource public function title(): string { - return __('laravel-site-settings::ui.settings'); + return trans('laravel-site-settings::ui.settings'); } public function fields(): array { return [ - Block::make(__('laravel-site-settings::ui.main'), [ + Block::make(trans('laravel-site-settings::ui.main'), [ ID::make()->sortable(), BelongsTo::make( - __('laravel-site-settings::ui.group'), + trans('laravel-site-settings::ui.group'), 'settingGroup', new SettingGroupResource() ) @@ -45,28 +45,28 @@ public function fields(): array ->sortable() ->showOnExport(), - Text::make(__('laravel-site-settings::ui.slug'), 'slug') + Text::make(trans('laravel-site-settings::ui.slug'), 'slug') ->required() ->sortable() ->hint('a-z, 0-9, -, _') ->showOnExport(), - Text::make(__('laravel-site-settings::ui.hint'), 'hint') + Text::make(trans('laravel-site-settings::ui.hint'), 'hint') ->nullable() ->sortable() - ->hint(__('laravel-site-settings::ui.not_used')) + ->hint(trans('laravel-site-settings::ui.not_used')) ->showOnExport(), - Textarea::make(__('laravel-site-settings::ui.value'), 'value')->nullable()->sortable() + Textarea::make(trans('laravel-site-settings::ui.value'), 'value')->nullable()->sortable() ->showOnExport(), - NoInput::make(__('laravel-site-settings::ui.created_at'), 'created_at', + NoInput::make(trans('laravel-site-settings::ui.created_at'), 'created_at', fn(Setting $item) => $item->created_at->isoFormat('lll')) ->sortable() ->hideOnForm() ->showOnExport(), - NoInput::make(__('laravel-site-settings::ui.updated_at'), 'updated_at', + NoInput::make(trans('laravel-site-settings::ui.updated_at'), 'updated_at', fn(Setting $item) => $item->updated_at->isoFormat('lll')) ->sortable() ->hideOnForm()