From 87f2c9ae5a30e8d01530cd37fe756a35c050b6d2 Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Tue, 6 Feb 2024 19:30:25 +0300 Subject: [PATCH] add more translation --- resources/lang/ar.json | 17 ++++++++++++++++- resources/lang/en.json | 17 ++++++++++++++++- src/Concerns/HasOptions.php | 2 +- src/Concerns/Schemata.php | 3 ++- src/Filament/Resources/FormResource.php | 18 +++++++++++++----- .../Resources/FormResource/Pages/EditForm.php | 11 +++++++++++ .../Resources/FormResource/Pages/ViewForm.php | 11 +++++++++++ 7 files changed, 70 insertions(+), 9 deletions(-) diff --git a/resources/lang/ar.json b/resources/lang/ar.json index 17ddd39a..445ae537 100644 --- a/resources/lang/ar.json +++ b/resources/lang/ar.json @@ -192,5 +192,20 @@ "List Entries": "عرض السجلات", "notes": "ملاحظات", "Open": "عرض", - "Preset": "القوالب" + "Preset": "القوالب", + "start date": "تاريخ البداية", + "end date": "تاريخ النهاية", + "Edit Form": "تعديل", + "Responses Entries": "الإدخالات", + "section options": "خيارات القسم", + "more section options": "خيارات", + "Visual Options": "خيارات العرض", + "compact section": "compact", + "Enable Conditional Visibility": "تفعيل", + "General Options": "خيارات عامة", + "Hint Options": "خيارات التلميح", + "advanced fields settings": "خيارات القسم المتقدمة", + "Extensions": "الملحقات", + "Design": "التصميم", + "View Form": "عرض" } diff --git a/resources/lang/en.json b/resources/lang/en.json index 00ade997..9fc53228 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -186,5 +186,20 @@ "Hint Color" :"Hint Color", "Textarea": "Textarea", "Paragraph": "Paragraph", - "Color Picker": "Color Picker" + "Color Picker": "Color Picker", + "start date": "start date", + "end date": "end date", + "Edit Form": "edit form", + "Responses Entries": "Responses Entries", + "section options": "section options", + "more section options": "more section options", + "Visual Options": "Visual Options", + "compact section": "compact section", + "Enable Conditional Visibility": "Enable Conditional Visibility", + "General Options": "General Options", + "Hint Options": "Hint Options", + "advanced fields settings": "advanced fields settings", + "Extensions": "Extensions", + "Design": "Design", + "View Form": "View Form" } diff --git a/src/Concerns/HasOptions.php b/src/Concerns/HasOptions.php index ce2d025e..007d6f5d 100644 --- a/src/Concerns/HasOptions.php +++ b/src/Concerns/HasOptions.php @@ -29,7 +29,7 @@ public static function visibility(?array $getFields = []): Accordion } return Accordion::make('visibility-options') - ->label('Conditional Visibility') + ->label(__('Conditional Visibility')) ->icon('iconpark-eyes') ->schema([ Toggle::make('options.visibility.active') diff --git a/src/Concerns/Schemata.php b/src/Concerns/Schemata.php index 8c28c9cd..6cee6d20 100644 --- a/src/Concerns/Schemata.php +++ b/src/Concerns/Schemata.php @@ -120,9 +120,10 @@ public static function getMainFormSchema(): array ->minItems(1) ->extraItemActions([ Action::make('options') + ->label(__('section options')) ->slideOver() ->color('warning') - ->tooltip('more section options') + ->tooltip(__('more section options')) ->icon('heroicon-m-cog') ->fillForm(fn ( array $arguments, diff --git a/src/Filament/Resources/FormResource.php b/src/Filament/Resources/FormResource.php index 07d3a520..b549582d 100644 --- a/src/Filament/Resources/FormResource.php +++ b/src/Filament/Resources/FormResource.php @@ -90,7 +90,8 @@ public static function infolist(Infolist $infolist): Infolist return $infolist ->schema([ Section::make()->schema([ - TextEntry::make('name'), + TextEntry::make('name') + ->label(__('name')), /*SimpleListEntry::make('links') ->inline(true) @@ -108,13 +109,16 @@ public static function infolist(Infolist $infolist): Infolist ->label(__('Form Links')),*/ TextEntry::make('slug') + ->label(__('slug')) ->url(fn (ZeusForm $record) => route('bolt.form.show', ['slug' => $record->slug])) ->visible(fn (ZeusForm $record) => $record->extensions === null) ->icon('heroicon-o-arrow-top-right-on-square') ->openUrlInNewTab(), - TextEntry::make('description'), + TextEntry::make('description') + ->label(__('description')), IconEntry::make('is_active') + ->label(__('is active')) ->icon(fn (string $state): string => match ($state) { '0' => 'clarity-times-circle-solid', default => 'clarity-check-circle-line', @@ -125,10 +129,14 @@ public static function infolist(Infolist $infolist): Infolist default => 'gray', }), - TextEntry::make('start_date')->dateTime(), - TextEntry::make('end_date')->dateTime(), + TextEntry::make('start_date') + ->label(__('start date')) + ->dateTime(), + TextEntry::make('end_date') + ->label(__('end date')) + ->dateTime(), ]) - ->columns(2), + ->columns(), ]); } diff --git a/src/Filament/Resources/FormResource/Pages/EditForm.php b/src/Filament/Resources/FormResource/Pages/EditForm.php index 219c0ea1..2bf67087 100644 --- a/src/Filament/Resources/FormResource/Pages/EditForm.php +++ b/src/Filament/Resources/FormResource/Pages/EditForm.php @@ -5,6 +5,7 @@ use Filament\Actions\Action; use Filament\Actions\LocaleSwitcher; use Filament\Resources\Pages\EditRecord; +use Illuminate\Contracts\Support\Htmlable; use LaraZeus\Bolt\Filament\Resources\FormResource; use LaraZeus\Bolt\Models\Form; @@ -17,6 +18,16 @@ class EditForm extends EditRecord protected static string $resource = FormResource::class; + public function getTitle(): string | Htmlable + { + return __('Edit Form'); + } + + public static function getNavigationLabel(): string + { + return __('Edit Form'); + } + protected function getHeaderActions(): array { return [ diff --git a/src/Filament/Resources/FormResource/Pages/ViewForm.php b/src/Filament/Resources/FormResource/Pages/ViewForm.php index 703b8bc3..ea72faf2 100644 --- a/src/Filament/Resources/FormResource/Pages/ViewForm.php +++ b/src/Filament/Resources/FormResource/Pages/ViewForm.php @@ -5,6 +5,7 @@ use Filament\Actions\Action; use Filament\Actions\LocaleSwitcher; use Filament\Resources\Pages\ViewRecord; +use Illuminate\Contracts\Support\Htmlable; use LaraZeus\Bolt\Filament\Resources\FormResource; use LaraZeus\Bolt\Models\Form; @@ -17,6 +18,16 @@ class ViewForm extends ViewRecord protected static string $resource = FormResource::class; + public function getTitle(): string | Htmlable + { + return __('View Form'); + } + + public static function getNavigationLabel(): string + { + return __('View Form'); + } + protected function getHeaderActions(): array { return [