Skip to content

Commit

Permalink
fix: Language string cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jul 16, 2024
1 parent e3b373a commit d64bc5a
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 816 deletions.
2 changes: 1 addition & 1 deletion app/Livewire/Other/GenerateSSHKeysButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function render(): View
private function checkAdmin(): bool
{
if (! Auth::user()?->isAdmin()) {
Toaster::error(__('You are not authorized to generate SSH keys.'));
Toaster::error(__('You do not have permission to perform this action.'));
Log::error('Non-admin user attempted to generate SSH keys.', ['user_id' => Auth::id()]);

return false;
Expand Down
2 changes: 0 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,5 @@
'available_languages' => [
'en' => 'English (English)',
'da' => 'Danish (Dansk)',
'zh' => 'Chinese (中文)',
'ru' => 'Russian (Русский)',
],
];
162 changes: 83 additions & 79 deletions lang/da.json

Large diffs are not rendered by default.

353 changes: 0 additions & 353 deletions lang/ru.json

This file was deleted.

354 changes: 0 additions & 354 deletions lang/zh.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
:value="__('Path of Directory on Remote Server to Backup')"/>
<x-text-input id="sourcePath" class="block mt-1 w-full" type="text"
wire:model="sourcePath"
placeholder="{{ __('/path/to/backup') }}"
placeholder="/path/to/backup"
name="sourcePath"/>
<x-input-error :messages="$errors->get('sourcePath')" class="mt-2"/>
<x-input-explain>{{ __('Please provide the UNIX path of the directory on your remote server that you would like to backup.') }}</x-input-explain>
Expand All @@ -198,25 +198,24 @@
<x-input-label for="excludedDatabaseTables" :value="__('Excluded Database Tables')"/>
<x-text-input id="excludedDatabaseTables" class="block mt-1 w-full" type="text"
wire:model="excludedDatabaseTables"
placeholder="{{ __('table1,table2,table3') }}"
placeholder="table1,table2,table3"
name="excludedDatabaseTables"/>
<x-input-error :messages="$errors->get('excludedDatabaseTables')" class="mt-2"/>
<x-input-explain>{{ __('If you want to exclude certain tables from the backup, you can list them here, separated by commas. For example: "table1,table2,table3". This can be useful if you have large tables that you don\'t need to back up.') }}</x-input-explain>
<x-input-explain>{{ __('If you want to exclude certain tables from the backup, you can list them here, separated by commas. This can be useful if you have large tables that you don\'t need to back up.') }}</x-input-explain>
</div>
@endif
<div class="mt-4">
<x-input-label for="appendedFileName" :value="__('Additional Filename Text')"/>
<x-text-input id="appendedFileName" class="block mt-1 w-full" type="text"
wire:model="appendedFileName"
placeholder="{{ __('laravel_app_db_backup') }}"
name="appendedFileName"/>
<x-input-error :messages="$errors->get('appendedFileName')" class="mt-2"/>
<x-input-explain>{{ __('You have the option to add extra characters to the filename. This can make it easier for you to identify the file later.') }}</x-input-explain>
</div>
<div class="mt-4">
<x-input-label for="storePath" :value="__('Backup Destination Directory')"/>
<x-text-input id="storePath" class="block mt-1 w-full" type="text" wire:model="storePath"
placeholder="{{ __('/save/to/path') }}"
placeholder="/save/to/path"
name="storePath"/>
<x-input-error :messages="$errors->get('storePath')" class="mt-2"/>
<x-input-explain>
Expand All @@ -234,13 +233,6 @@
</div>
@if ($useIsolatedCredentials)
<div wire:transition>
<div
class="mx-3 py-2 px-4 bg-amber-50 text-amber-600 border-l-4 border-amber-600 font-medium my-6">
@svg('heroicon-o-exclamation-triangle', 'h-5 w-5 inline mr-2')
<span>
{{ __('This feature is a work in progress, if there is an issue please let us know!') }}
</span>
</div>
<div class="mt-4 flex space-x-6">
<div class="w-3/6">
<x-input-label for="isolatedUsername" :value="__('Username')"/>
Expand Down Expand Up @@ -302,7 +294,7 @@ class="mx-3 py-2 px-4 bg-amber-50 text-amber-600 border-l-4 border-amber-600 fon
{{ __('We recommend using a tool such as') }}
<a href="https://crontab.guru" _target="_blank"
class="text-sm text-gray-600 dark:text-gray-400 underline hover:text-gray-900 dark:hover:text-gray-100 ease-in-out">
{{ __('Crontab Guru') }}
Crontab Guru
</a>
{{ __('to help you generate a valid cron expression.') }}
</x-input-explain>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<div class="mt-4">
<x-input-label for="sourcePath" :value="__('Path of Directory on Remote Server to Backup')"/>
<x-text-input id="sourcePath" class="block mt-1 w-full" type="text" wire:model="sourcePath"
placeholder="{{ __('/path/to/backup') }}"
placeholder="/path/to/backup"
name="sourcePath"/>
<x-input-error :messages="$errors->get('sourcePath')" class="mt-2"/>
<x-input-explain>{{ __('Please provide the UNIX path of the directory on your remote server that you would like to backup.') }}</x-input-explain>
Expand All @@ -89,24 +89,23 @@
<div class="mt-4">
<x-input-label for="excludedDatabaseTables" :value="__('Excluded Database Tables')"/>
<x-text-input id="excludedDatabaseTables" class="block mt-1 w-full" type="text"
wire:model="excludedDatabaseTables" placeholder="{{ __('table1,table2,table3') }}"
wire:model="excludedDatabaseTables" placeholder="table1,table2,table3"
name="excludedDatabaseTables"/>
<x-input-error :messages="$errors->get('excludedDatabaseTables')" class="mt-2"/>
<x-input-explain>{{ __('If you want to exclude certain tables from the backup, you can list them here, separated by commas. For example: "table1,table2,table3". This can be useful if you have large tables that you don\'t need to back up.') }}</x-input-explain>
<x-input-explain>{{ __('If you want to exclude certain tables from the backup, you can list them here, separated by commas. This can be useful if you have large tables that you don\'t need to back up.') }}</x-input-explain>
</div>
@endif
<div class="mt-4">
<x-input-label for="appendedFileName" :value="__('Additional Filename Text')"/>
<x-text-input id="appendedFileName" class="block mt-1 w-full" type="text" wire:model="appendedFileName"
placeholder="{{ __('laravel_app_db_backup') }}"
name="appendedFileName"/>
<x-input-error :messages="$errors->get('appendedFileName')" class="mt-2"/>
<x-input-explain>{{ __('You have the option to add extra characters to the filename. This can make it easier for you to identify the file later.') }}</x-input-explain>
</div>
<div class="mt-4">
<x-input-label for="storePath" :value="__('Backup Destination Directory')"/>
<x-text-input id="storePath" class="block mt-1 w-full" type="text" wire:model="storePath"
placeholder="{{ __('/save/to/path') }}"
placeholder="/save/to/path"
name="storePath"/>
<x-input-error :messages="$errors->get('storePath')" class="mt-2"/>
<x-input-explain>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
</div>

<div class="col-span-12 sm:col-span-3 mt-2 sm:mt-0">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {{ $scheduledBackupTask->type === 'Files' ? 'bg-purple-100 text-purple-800 dark:bg-purple-800 dark:text-purple-100' : 'bg-cyan-100 text-cyan-800 dark:bg-cyan-800 dark:text-cyan-100' }}">
@svg($scheduledBackupTask->type === 'Files' ? 'heroicon-o-document-duplicate' : 'heroicon-o-circle-stack', 'h-4 w-4 mr-1')
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {{ $scheduledBackupTask->type === __('Files') ? 'bg-purple-100 text-purple-800 dark:bg-purple-800 dark:text-purple-100' : 'bg-cyan-100 text-cyan-800 dark:bg-cyan-800 dark:text-cyan-100' }}">
@svg($scheduledBackupTask->type === __('Files') ? 'heroicon-o-document-duplicate' : 'heroicon-o-circle-stack', ['class' => 'h-4 w-4 mr-1'])
{{ ucfirst($scheduledBackupTask->type) }}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
</div>
<div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-3 my-1.5">
<x-secondary-button type="button" wire:click="usingServerProvider('ploi')" class="w-full sm:w-auto">
{{ __('Ploi') }}
'Ploi
</x-secondary-button>
<x-secondary-button type="button" wire:click="usingServerProvider('forge')" class="w-full sm:w-auto">
{{ __('Laravel Forge') }}
Laravel Forge
</x-secondary-button>
</div>
</div>
Expand Down Expand Up @@ -84,8 +84,7 @@ class="py-3.5 px-4 bg-gray-200 dark:bg-gray-600 dark:text-gray-200 text-gray-600
<div class="mt-4">
<x-input-label for="label" :value="__('Label')"/>
<x-text-input id="label" class="block mt-1 w-full" type="text" wire:model="label" name="label"
autofocus
placeholder="{{ __('sunny-village') }}"/>
autofocus />
<x-input-error :messages="$errors->get('label')" class="mt-2"/>
</div>
<div class="mt-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<div class="mt-4">
<x-input-label for="label" :value="__('Label')"/>
<x-text-input id="label" class="block mt-1 w-full" type="text" wire:model="label" name="label"
autofocus
placeholder="{{ __('sunny-village') }}"/>
autofocus />
<x-input-error :messages="$errors->get('label')" class="mt-2"/>
</div>
<div class="mt-4">
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Livewire/Other/GenerateSSHKeysButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
Livewire::test(GenerateSSHKeysButton::class)
->call('generateKeys');

Toaster::assertDispatched(__('You are not authorized to generate SSH keys.'));
Toaster::assertDispatched(__('You do not have permission to perform this action.'));
$this->assertFalse($user->isAdmin());
});

0 comments on commit d64bc5a

Please sign in to comment.