Skip to content

Commit

Permalink
style(Localization): Change function trans
Browse files Browse the repository at this point in the history
  • Loading branch information
SWEET1S committed Jul 18, 2023
1 parent 8b28e6b commit 7ae49ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions src/MoonShine/Resources/SettingGroupResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
18 changes: 9 additions & 9 deletions src/MoonShine/Resources/SettingResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,46 @@ 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()
)
->nullable()
->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()
Expand Down

0 comments on commit 7ae49ea

Please sign in to comment.