Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support multilang to livewire #101

Merged
merged 1 commit into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions stubs/livewire/resources/views/api/api-token-manager.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<!-- Generate API Token -->
<x-jet-form-section submit="createApiToken">
<x-slot name="title">
Create API Token
{{ __('Create API Token') }}
</x-slot>

<x-slot name="description">
API tokens allow third-party services to authenticate with our application on your behalf.
{{ __('API tokens allow third-party services to authenticate with our application on your behalf.') }}
</x-slot>

<x-slot name="form">
Expand Down Expand Up @@ -36,11 +36,11 @@

<x-slot name="actions">
<x-jet-action-message class="mr-3" on="created">
Created.
{{ __('Created.') }}
</x-jet-action-message>

<x-jet-button>
Create
{{ __('Create') }}
</x-jet-button>
</x-slot>
</x-jet-form-section>
Expand All @@ -52,11 +52,11 @@
<div class="mt-10 sm:mt-0">
<x-jet-action-section>
<x-slot name="title">
Manage API Tokens
{{ __('Manage API Tokens') }}
</x-slot>

<x-slot name="description">
You may delete any of your existing tokens if they are no longer needed.
{{ __('You may delete any of your existing tokens if they are no longer needed.') }}
</x-slot>

<!-- API Token List -->
Expand All @@ -77,12 +77,12 @@

@if (Laravel\Jetstream\Jetstream::hasPermissions())
<button class="cursor-pointer ml-6 text-sm text-gray-400 underline focus:outline-none" wire:click="manageApiTokenPermissions({{ $token->id }})">
Permissions
{{ __('Permissions') }}
</button>
@endif

<button class="cursor-pointer ml-6 text-sm text-red-500 focus:outline-none" wire:click="confirmApiTokenDeletion({{ $token->id }})">
Delete
{{ __('Delete') }}
</button>
</div>
</div>
Expand All @@ -96,12 +96,12 @@
<!-- Token Value Modal -->
<x-jet-dialog-modal wire:model="displayingToken">
<x-slot name="title">
API Token
{{ __('API Token') }}
</x-slot>

<x-slot name="content">
<div>
Please copy your new API token. For your security, it won't be shown again.
{{ __('Please copy your new API token. For your security, it won\'t be shown again.') }}
</div>

<div class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500">
Expand All @@ -111,15 +111,15 @@

<x-slot name="footer">
<x-jet-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
Close
{{ __('Close') }}
</x-jet-secondary-button>
</x-slot>
</x-jet-dialog-modal>

<!-- API Token Permissions Modal -->
<x-jet-dialog-modal wire:model="managingApiTokenPermissions">
<x-slot name="title">
API Token Permissions
{{ __('API Token Permissions') }}
</x-slot>

<x-slot name="content">
Expand All @@ -135,32 +135,32 @@

<x-slot name="footer">
<x-jet-secondary-button wire:click="$set('managingApiTokenPermissions', false)" wire:loading.attr="disabled">
Nevermind
{{ __('Nevermind') }}
</x-jet-secondary-button>

<x-jet-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled">
Save
{{ __('Save') }}
</x-jet-button>
</x-slot>
</x-jet-dialog-modal>

<!-- Delete Token Confirmation Modal -->
<x-jet-confirmation-modal wire:model="confirmingApiTokenDeletion">
<x-slot name="title">
Delete API Token
{{ __('Delete API Token') }}
</x-slot>

<x-slot name="content">
Are you sure you would like to delete this API token?
{{ __('Are you sure you would like to delete this API token?') }}
</x-slot>

<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled">
Nevermind
{{ __('Nevermind') }}
</x-jet-secondary-button>

<x-jet-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.attr="disabled">
Delete
{{ __('Delete') }}
</x-jet-danger-button>
</x-slot>
</x-jet-confirmation-modal>
Expand Down
2 changes: 1 addition & 1 deletion stubs/livewire/resources/views/api/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
API Tokens
{{ __('API Tokens') }}
</h2>
</x-slot>

Expand Down
2 changes: 1 addition & 1 deletion stubs/livewire/resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
Dashboard
{{ __('Dashboard') }}
</h2>
</x-slot>

Expand Down
34 changes: 17 additions & 17 deletions stubs/livewire/resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
<x-jet-nav-link href="/dashboard" :active="request()->routeIs('dashboard')">
Dashboard
{{ __('Dashboard') }}
</x-jet-nav-link>
</div>
</div>
Expand All @@ -52,16 +52,16 @@
<x-slot name="content">
<!-- Account Management -->
<div class="block px-4 py-2 text-xs text-gray-400">
Manage Account
{{ __('Manage Account') }}
</div>

<x-jet-dropdown-link href="/user/profile">
Profile
{{ __('Profile') }}
</x-jet-dropdown-link>

@if (Laravel\Jetstream\Jetstream::hasApiFeatures())
<x-jet-dropdown-link href="/user/api-tokens">
API Tokens
{{ __('API Tokens') }}
</x-jet-dropdown-link>
@endif

Expand All @@ -70,25 +70,25 @@
<!-- Team Management -->
@if (Laravel\Jetstream\Jetstream::hasTeamFeatures())
<div class="block px-4 py-2 text-xs text-gray-400">
Manage Team
{{ __('Manage Team') }}
</div>

<!-- Team Settings -->
<x-jet-dropdown-link href="/teams/{{ Auth::user()->currentTeam->id }}">
Team Settings
{{ __('Team Settings') }}
</x-jet-dropdown-link>

@can('create', Laravel\Jetstream\Jetstream::newTeamModel())
<x-jet-dropdown-link href="/teams/create">
Create New Team
{{ __('Create New Team') }}
</x-jet-dropdown-link>
@endcan

<div class="border-t border-gray-100"></div>

<!-- Team Switcher -->
<div class="block px-4 py-2 text-xs text-gray-400">
Switch Teams
{{ __('Switch Teams') }}
</div>

@foreach (Auth::user()->allTeams() as $team)
Expand All @@ -105,7 +105,7 @@
<x-jet-dropdown-link href="{{ route('logout') }}"
onclick="event.preventDefault();
this.closest('form').submit();">
Logout
{{ __('Logout') }}
</x-jet-dropdown-link>
</form>
</x-slot>
Expand All @@ -128,7 +128,7 @@
<div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
<div class="pt-2 pb-3 space-y-1">
<x-jet-responsive-nav-link href="/dashboard" :active="request()->routeIs('dashboard')">
Dashboard
{{ __('Dashboard') }}
</x-jet-responsive-nav-link>
</div>

Expand All @@ -148,12 +148,12 @@
<div class="mt-3 space-y-1">
<!-- Account Management -->
<x-jet-responsive-nav-link href="/user/profile" :active="request()->routeIs('profile.show')">
Profile
{{ __('Profile') }}
</x-jet-responsive-nav-link>

@if (Laravel\Jetstream\Jetstream::hasApiFeatures())
<x-jet-responsive-nav-link href="/user/api-tokens" :active="request()->routeIs('api-tokens.index')">
API Tokens
{{ __('API Tokens') }}
</x-jet-responsive-nav-link>
@endif

Expand All @@ -164,7 +164,7 @@
<x-jet-responsive-nav-link href="{{ route('logout') }}"
onclick="event.preventDefault();
this.closest('form').submit();">
Logout
{{ __('Logout') }}
</x-jet-responsive-nav-link>
</form>

Expand All @@ -173,23 +173,23 @@
<div class="border-t border-gray-200"></div>

<div class="block px-4 py-2 text-xs text-gray-400">
Manage Team
{{ __('Manage Team') }}
</div>

<!-- Team Settings -->
<x-jet-responsive-nav-link href="/teams/{{ Auth::user()->currentTeam->id }}" :active="request()->routeIs('teams.show')">
Team Settings
{{ __('Team Settings') }}
</x-jet-responsive-nav-link>

<x-jet-responsive-nav-link href="/teams/create" :active="request()->routeIs('teams.create')">
Create New Team
{{ __('Create New Team') }}
</x-jet-responsive-nav-link>

<div class="border-t border-gray-200"></div>

<!-- Team Switcher -->
<div class="block px-4 py-2 text-xs text-gray-400">
Switch Teams
{{ __('Switch Teams') }}
</div>

@foreach (Auth::user()->allTeams() as $team)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<x-jet-action-section>
<x-slot name="title">
Delete Account
{{ __('Delete Account') }}
</x-slot>

<x-slot name="description">
Permanently delete your account.
{{ __('Permanently delete your account.') }}
</x-slot>

<x-slot name="content">
<div class="max-w-xl text-sm text-gray-600">
Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.
{{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.') }}
</div>

<div class="mt-5">
<x-jet-danger-button wire:click="confirmUserDeletion" wire:loading.attr="disabled">
Delete Account
{{ __('Delete Account') }}
</x-jet-danger-button>
</div>

<!-- Delete User Confirmation Modal -->
<x-jet-dialog-modal wire:model="confirmingUserDeletion">
<x-slot name="title">
Delete Account
{{ __('Delete Account') }}
</x-slot>

<x-slot name="content">
Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.
{{ __('Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }}

<div class="mt-4" x-data="{}" x-on:confirming-delete-user.window="setTimeout(() => $refs.password.focus(), 250)">
<x-jet-input type="password" class="mt-1 block w-3/4" placeholder="Password"
Expand All @@ -39,11 +39,11 @@

<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingUserDeletion')" wire:loading.attr="disabled">
Nevermind
{{ __('Nevermind') }}
</x-jet-secondary-button>

<x-jet-danger-button class="ml-2" wire:click="deleteUser" wire:loading.attr="disabled">
Delete Account
{{ __('Delete Account') }}
</x-jet-danger-button>
</x-slot>
</x-jet-dialog-modal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<x-jet-action-section>
<x-slot name="title">
Browser Sessions
{{ __('Browser Sessions') }}
</x-slot>

<x-slot name="description">
Manage and logout your active sessions on other browsers and devices.
{{ __('Manage and logout your active sessions on other browsers and devices.') }}
</x-slot>

<x-slot name="content">
<div class="max-w-xl text-sm text-gray-600">
If necessary, you may logout of all of your other browser sessions across all of your devices. If you feel your account has been compromised, you should also update your password.
{{ __('If necessary, you may logout of all of your other browser sessions across all of your devices. If you feel your account has been compromised, you should also update your password.') }}
</div>

@if (count($this->sessions) > 0)
Expand Down Expand Up @@ -39,9 +39,9 @@
{{ $session->ip_address }},

@if ($session->is_current_device)
<span class="text-green-500 font-semibold">This device</span>
<span class="text-green-500 font-semibold">{{ __('This device') }}</span>
@else
Last active {{ $session->last_active }}
{{ __('Last active') }} {{ $session->last_active }}
@endif
</div>
</div>
Expand All @@ -53,22 +53,22 @@

<div class="flex items-center mt-5">
<x-jet-button wire:click="confirmLogout" wire:loading.attr="disabled">
Logout Other Browser Sessions
{{ __('Logout Other Browser Sessions') }}
</x-jet-button>

<x-jet-action-message class="ml-3" on="loggedOut">
Done.
{{ __('Done.') }}
</x-jet-action-message>
</div>

<!-- Logout Other Devices Confirmation Modal -->
<x-jet-dialog-modal wire:model="confirmingLogout">
<x-slot name="title">
Logout Other Browser Sessions
{{ __('Logout Other Browser Sessions') }}
</x-slot>

<x-slot name="content">
Please enter your password to confirm you would like to logout of your other browser sessions across all of your devices.
{{ __('Please enter your password to confirm you would like to logout of your other browser sessions across all of your devices.') }}

<div class="mt-4" x-data="{}" x-on:confirming-logout-other-browser-sessions.window="setTimeout(() => $refs.password.focus(), 250)">
<x-jet-input type="password" class="mt-1 block w-3/4" placeholder="Password"
Expand All @@ -82,11 +82,11 @@

<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingLogout')" wire:loading.attr="disabled">
Nevermind
{{ __('Nevermind') }}
</x-jet-secondary-button>

<x-jet-button class="ml-2" wire:click="logoutOtherBrowserSessions" wire:loading.attr="disabled">
Logout Other Browser Sessions
{{ __('Logout Other Browser Sessions') }}
</x-jet-button>
</x-slot>
</x-jet-dialog-modal>
Expand Down
Loading