Skip to content

Commit

Permalink
Update legal translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Apr 30, 2024
1 parent 051abef commit 5dd831f
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{ $this->form }}

<div class="mt-6 flex justify-end">
<x-shopper::buttons.primary wire:click="store" type="submit" wire:loading.attr="disabled">
<x-shopper::buttons.primary type="submit" wire:loading.attr="disabled">
<x-shopper::loader wire:loading wire:target="store" class="text-white" />
{{ __('shopper::forms.actions.save') }}
</x-shopper::buttons.primary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="lg:grid lg:grid-cols-3 lg:gap-x-12 lg:gap-y-6">
<x-shopper::section-heading class="lg:col-span-1" :title="$title" :description="$description" />

<livewire:shopper-settings.legal.form :legal="$legal" />
</div>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<x-shopper::container>
<x-shopper::breadcrumb
:back="route('shopper.settings.index')"
:current="__('shopper::pages/settings.legal.title')"
:current="__('shopper::pages/settings/global.legal.title')"
>
<x-untitledui-chevron-left class="h-4 w-4 shrink-0 text-gray-300 dark:text-gray-600" aria-hidden="true" />
<x-shopper::breadcrumb.link
Expand All @@ -15,50 +15,50 @@
</x-shopper::breadcrumb>
<x-shopper::heading class="my-6">
<x-slot name="title">
{{ __('shopper::pages/settings.legal.title') }}
{{ __('shopper::pages/settings/global.legal.title') }}
</x-slot>
</x-shopper::heading>
</x-shopper::container>

<div class="relative border-t border-gray-200 dark:border-gray-700">
<x-filament::tabs :contained="true">
<x-filament::tabs.item alpine-active="currentTab === 'privacy'" x-on:click="currentTab = 'privacy'">
{{ __('shopper::pages/settings.legal.privacy') }}
{{ __('shopper::pages/settings/global.legal.privacy') }}
</x-filament::tabs.item>
<x-filament::tabs.item alpine-active="currentTab === 'terms'" x-on:click="currentTab = 'terms'">
{{ __('shopper::pages/settings.legal.terms_of_use') }}
{{ __('shopper::pages/settings/global.legal.terms_of_use') }}
</x-filament::tabs.item>
<x-filament::tabs.item alpine-active="currentTab === 'shipping'" x-on:click="currentTab = 'shipping'">
{{ __('shopper::pages/settings.legal.shipping') }}
{{ __('shopper::pages/settings/global.legal.shipping') }}
</x-filament::tabs.item>
<x-filament::tabs.item alpine-active="currentTab === 'refund'" x-on:click="currentTab = 'refund'">
{{ __('shopper::pages/settings.legal.refund') }}
{{ __('shopper::pages/settings/global.legal.refund') }}
</x-filament::tabs.item>
</x-filament::tabs>
</div>

<x-shopper::container class="mt-8">
<div x-show="currentTab === 'refund'">
<livewire:shopper-settings.legal.refund
:legal="$legals[Str::slug(__('shopper::pages/settings.legal.refund'))]"
:legal="$legals[Str::slug(__('shopper::pages/settings/global.legal.refund'))]"
/>
</div>
<div x-cloak x-show="currentTab === 'privacy'">
<livewire:shopper-settings.legal.privacy
:legal="$legals[Str::slug(__('shopper::pages/settings.legal.privacy'))]"
:legal="$legals[Str::slug(__('shopper::pages/settings/global.legal.privacy'))]"
/>
</div>
<div x-cloak x-show="currentTab === 'terms'">
<livewire:shopper-settings.legal.terms
:legal="$legals[Str::slug(__('shopper::pages/settings.legal.terms_of_use'))]"
:legal="$legals[Str::slug(__('shopper::pages/settings/global.legal.terms_of_use'))]"
/>
</div>
<div x-cloak x-show="currentTab === 'shipping'">
<livewire:shopper-settings.legal.shipping
:legal="$legals[Str::slug(__('shopper::pages/settings.legal.shipping'))]"
:legal="$legals[Str::slug(__('shopper::pages/settings/global.legal.shipping'))]"
/>
</div>
</x-shopper::container>

<x-shopper::learn-more :name="__('shopper::pages/settings.legal.title')" link="legal" />
<x-shopper::learn-more :name="__('shopper::pages/settings/global.legal.title')" link="legal" />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function form(Form $form): Form
->schema([
Components\Hidden::make('title'),
Components\Toggle::make('is_enabled')
->label(__('shopper::forms.actions.enabled'))
->label(__('shopper::words.is_enabled'))
->onColor('success'),
Components\RichEditor::make('content')
->label(__('shopper::forms.label.content'))
Expand All @@ -50,6 +50,7 @@ public function store(): void
], $this->form->getState());

Notification::make()
->title($this->legal->title)
->body(__('shopper::notifications.legal'))
->success()
->send();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Privacy extends Component

public function render(): View
{
return view('shopper::livewire.components.settings.legal.privacy');
return view('shopper::livewire.components.settings.legal.index', [
'title' => __('shopper::pages/settings/global.legal.privacy'),
'description' => __('shopper::pages/settings/global.legal.summary', ['policy' => __('shopper::pages/settings/global.legal.privacy')]),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Refund extends Component

public function render(): View
{
return view('shopper::livewire.components.settings.legal.refund');
return view('shopper::livewire.components.settings.legal.index', [
'title' => __('shopper::pages/settings/global.legal.refund'),
'description' => __('shopper::pages/settings/global.legal.summary', ['policy' => __('shopper::pages/settings/global.legal.refund')]),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Shipping extends Component

public function render(): View
{
return view('shopper::livewire.components.settings.legal.shipping');
return view('shopper::livewire.components.settings.legal.index', [
'title' => __('shopper::pages/settings/global.legal.shipping'),
'description' => __('shopper::pages/settings/global.legal.summary', ['policy' => __('shopper::pages/settings/global.legal.shipping')]),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Terms extends Component

public function render(): View
{
return view('shopper::livewire.components.settings.legal.terms');
return view('shopper::livewire.components.settings.legal.index', [
'title' => __('shopper::pages/settings/global.legal.terms_of_use'),
'description' => __('shopper::pages/settings/global.legal.summary', ['policy' => __('shopper::pages/settings/global.legal.terms_of_use')]),
]);
}
}
2 changes: 1 addition & 1 deletion packages/admin/src/Livewire/Pages/Settings/LegalPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public function render(): View
return view('shopper::livewire.pages.settings.legal', [
'legals' => Legal::query()->get()->mapWithKeys(fn (Legal $item) => [$item->slug => $item]),
])
->title(__('shopper::pages/settings.legal.title'));
->title(__('shopper::pages/settings/global.legal.title'));
}
}

0 comments on commit 5dd831f

Please sign in to comment.