Skip to content

Commit 9784e59

Browse files
Merge pull request #6 from bhcosta90/2.x
localizing some words
2 parents 4f4035b + 70884e4 commit 9784e59

File tree

6 files changed

+30
-29
lines changed

6 files changed

+30
-29
lines changed

app/Livewire/Traits/Alert.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@ trait Alert
1212
public function success(string $title = 'Done!', string $description = 'Task completed successfully.'): void
1313
{
1414
$this->dialog()
15-
->success($title, $description)
15+
->success(__($title), __($description))
1616
->send();
1717
}
1818

1919
public function error(string $title = 'Ooops!', string $description = 'Something went wrong!'): void
2020
{
2121
$this->dialog()
22-
->error($title, $description)
22+
->error(__($title), __($description))
2323
->send();
2424
}
2525

2626
public function warning(string $title = 'Ooops!', string $description = null): void
2727
{
2828
$this->dialog()
29-
->warning($title, $description)
29+
->warning(__($title), __($description))
3030
->send();
3131
}
3232

3333
public function info(string $title = 'Warning!', string $description = null): void
3434
{
3535
$this->dialog()
36-
->info($title, $description)
36+
->info(__($title), __($description))
3737
->send();
3838
}
3939

4040
public function question(string $title = 'Warning!', string $description = 'Are you sure?'): Dialog
4141
{
42-
return $this->dialog()->question($title, $description);
42+
return $this->dialog()->question(__($title), __($description));
4343
}
4444
}

resources/views/layouts/app.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
</x-slot:action>
4141
<form method="POST" action="{{ route('logout') }}">
4242
@csrf
43-
<x-dropdown.items text="Profile" :href="route('user.profile')" />
44-
<x-dropdown.items text="Logout" onclick="event.preventDefault(); this.closest('form').submit();" separator />
43+
<x-dropdown.items :text="__('Profile')" :href="route('user.profile')" />
44+
<x-dropdown.items :text="__('Logout')" onclick="event.preventDefault(); this.closest('form').submit();" separator />
4545
</form>
4646
</x-dropdown>
4747
</x-slot:right>

resources/views/livewire/user/profile.blade.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<div @updated="$dispatch('name-updated', { name: $event.detail.name })">
22
<x-card>
33
<x-slot:header>
4-
Edit Your Profile
4+
@lang('Edit Your Profile')
55
</x-slot:header>
66
<form id="update-profile" wire:submit="save">
77
<div class="space-y-6">
88
<div>
9-
<x-input label="Name *" wire:model="user.name" required />
9+
<x-input label="{{ __('Name') }} *" wire:model="user.name" required />
1010
</div>
1111
<div>
12-
<x-input label="Email *" value="{{ $user->email }}" disabled />
12+
<x-input label="{{ __('Email') }} *" value="{{ $user->email }}" disabled />
1313
</div>
1414
<div>
15-
<x-password label="Password"
16-
hint="The password will only be updated if you set the value of this field"
15+
<x-password :label="__('Password')"
16+
:hint="__('The password will only be updated if you set the value of this field')"
1717
wire:model="password"
1818
rules
1919
generator
2020
x-on:generate="$wire.set('password_confirmation', $event.detail.password)" />
2121
</div>
2222
<div>
23-
<x-password label="Password" wire:model="password_confirmation" rules />
23+
<x-password :label="__('Confirm password')" wire:model="password_confirmation" rules />
2424
</div>
2525
</div>
2626
<x-slot:footer>
2727
<x-button type="submit">
28-
Save
28+
@lang('Save')
2929
</x-button>
3030
</x-slot:footer>
3131
</form>
3232
<x-slot:footer>
3333
<x-button type="submit" form="update-profile">
34-
Save
34+
@lang('Save')
3535
</x-button>
3636
</x-slot:footer>
3737
</x-card>

resources/views/livewire/users/create.blade.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<div>
2-
<x-button text="Create New User" wire:click="$toggle('modal')" sm />
2+
<x-button :text="__('Create New User')" wire:click="$toggle('modal')" sm />
33

44
<x-modal :title="__('Create New User')" wire x-on:open="setTimeout(() => $refs.name.focus(), 250)">
55
<form id="user-create" wire:submit="save" class="space-y-4">
66
<div>
7-
<x-input label="Name *" x-ref="name" wire:model="user.name" required />
7+
<x-input label="{{ __('Name') }} *" x-ref="name" wire:model="user.name" required />
88
</div>
99

1010
<div>
11-
<x-input label="Email *" wire:model="user.email" required />
11+
<x-input label="{{ __('Email') }} *" wire:model="user.email" required />
1212
</div>
1313

1414
<div>
15-
<x-password label="Password *"
15+
<x-password label="{{ __('Password') }} *"
1616
wire:model="password"
1717
rules
1818
generator
@@ -21,12 +21,12 @@
2121
</div>
2222

2323
<div>
24-
<x-password label="Password" wire:model="password_confirmation" rules required />
24+
<x-password :label="__('Password')" wire:model="password_confirmation" rules required />
2525
</div>
2626
</form>
2727
<x-slot:footer>
2828
<x-button type="submit" form="user-create">
29-
Save
29+
@lang('Save')
3030
</x-button>
3131
</x-slot:footer>
3232
</x-modal>

resources/views/livewire/users/index.blade.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<div>
22
<x-alert color="amber" icon="light-bulb">
3-
Remember to take a look at the source code to understand how the components in this area were built and are being used.
3+
@lang('Remember to take a look at the source code to understand how the components in this area were built and are being used.')
44
</x-alert>
55

66
<div class="mb-2 mt-4">
77
<livewire:users.create @created="$refresh" />
88
</div>
99

10-
<x-table :$headers :$sort :rows="$this->rows" paginate simple-pagination filter>
10+
<x-table :$headers :$sort :rows="$this->rows" paginate simple-pagination filter :quantity="[2, 5, 15, 25]">
1111
@interact('column_created_at', $row)
1212
{{ $row->created_at->diffForHumans() }}
1313
@endinteract
14+
1415
@interact('column_action', $row)
1516
<div class="flex gap-1">
1617
<x-button.circle icon="pencil" wire:click="$dispatch('load::user', { 'user' : '{{ $row->id }}'})" />
17-
<livewire:users.delete :user="$row" :key="uniqid()" @deleted="$refresh" />
18+
<livewire:users.delete :user="$row" :key="uniqid('', true)" @deleted="$refresh" />
1819
</div>
1920
@endinteract
2021
</x-table>

resources/views/livewire/users/update.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<x-modal :title="__('Update User: #:id', ['id' => $user?->id])" wire>
33
<form id="user-update-{{ $user?->id }}" wire:submit="save" class="space-y-4">
44
<div>
5-
<x-input label="Name *" wire:model="user.name" required />
5+
<x-input label="{{ __('Name') }} *" wire:model="user.name" required />
66
</div>
77

88
<div>
9-
<x-input label="Email *" wire:model="user.email" required />
9+
<x-input label="{{ __('Email') }} *" wire:model="user.email" required />
1010
</div>
1111

1212
<div>
13-
<x-password label="Password"
13+
<x-password :label="__('Password')"
1414
hint="The password will only be updated if you set the value of this field"
1515
wire:model="password"
1616
rules
@@ -19,12 +19,12 @@
1919
</div>
2020

2121
<div>
22-
<x-password label="Password" wire:model="password_confirmation" rules />
22+
<x-password :label="__('Password')" wire:model="password_confirmation" rules />
2323
</div>
2424
</form>
2525
<x-slot:footer>
2626
<x-button type="submit" form="user-update-{{ $user?->id }}">
27-
Save
27+
@lang('Save')
2828
</x-button>
2929
</x-slot:footer>
3030
</x-modal>

0 commit comments

Comments
 (0)