From bcae8f01e964d322d583c146f0a2600973f5814d Mon Sep 17 00:00:00 2001 From: Fady Mondy Date: Sun, 7 Apr 2024 01:38:23 +0200 Subject: [PATCH] update translations input --- resources/lang/ar/messages.php | 30 ++++++++++++++++++++++ resources/lang/en/messages.php | 30 ++++++++++++++++++++++ src/FilamentAlertsServiceProvider.php | 12 ++++----- src/Pages/EmailSettingsPage.php | 34 ++++++++++++------------- src/Pages/NotificationsSettingsPage.php | 24 ++++++++--------- 5 files changed, 95 insertions(+), 35 deletions(-) diff --git a/resources/lang/ar/messages.php b/resources/lang/ar/messages.php index 4aa666a..36094da 100644 --- a/resources/lang/ar/messages.php +++ b/resources/lang/ar/messages.php @@ -55,5 +55,35 @@ "created_at" => "تم إنشاءه في", "updated_at" => "تم تحديثه في", ] + ], + "settings" => [ + "group" => "التنبيهات", + "firebase" => [ + "title" => "إعدادات فايربيز", + "description" => "تحديث الاعدادات الخاصة بالفايربيز", + "notifications_allow" => "تفعيل التنبيهات", + "fcm_apiKey" => "FCM API Key", + "fcm_authDomain" => "FCM Auth Domain", + "fcm_projectId" => "FCM Project Id", + "fcm_storageBucket" => "FCM Storage Bucket", + "fcm_messagingSenderId" => "FCM Messaging Sender Id", + "fcm_appId" => "FCM App Id", + "fcm_measurementId" => "FCM Measurement Id", + "fcm_cr" => "FCM Admin Json", + "fcm_database_url" => "FCM Database Url", + "fcm_vapid" => "FCM Vapid", + ], + "email" => [ + "title" => "إعدادات البريد الالكتروني", + "description" => "تحديث وربط البريد الالكتروني", + "mail_mailer" => "Mailer", + "mail_host" => "Host", + "mail_port" => "Port", + "mail_username" => "Username", + "mail_password" => "Password", + "mail_encryption" => "Encryption", + "mail_from_address" => "From address", + "mail_from_name" => "From Name", + ] ] ]; diff --git a/resources/lang/en/messages.php b/resources/lang/en/messages.php index 0a6c021..969cf28 100644 --- a/resources/lang/en/messages.php +++ b/resources/lang/en/messages.php @@ -55,5 +55,35 @@ "created_at" => "Created At", "updated_at" => "Updated At", ] + ], + "settings" => [ + "group" => "Notifications", + "firebase" => [ + "title" => "Firebase Settings", + "description" => "Update firebase connection settings", + "notifications_allow" => "Allow Notifications", + "fcm_apiKey" => "FCM API Key", + "fcm_authDomain" => "FCM Auth Domain", + "fcm_projectId" => "FCM Project Id", + "fcm_storageBucket" => "FCM Storage Bucket", + "fcm_messagingSenderId" => "FCM Messaging Sender Id", + "fcm_appId" => "FCM App Id", + "fcm_measurementId" => "FCM Measurement Id", + "fcm_cr" => "FCM Admin Json", + "fcm_database_url" => "FCM Database Url", + "fcm_vapid" => "FCM Vapid", + ], + "email" => [ + "title" => "Email Settings", + "description" => "Update email provider connection settings", + "mail_mailer" => "Mailer", + "mail_host" => "Host", + "mail_port" => "Port", + "mail_username" => "Username", + "mail_password" => "Password", + "mail_encryption" => "Encryption", + "mail_from_address" => "From address", + "mail_from_name" => "From Name", + ] ] ]; diff --git a/src/FilamentAlertsServiceProvider.php b/src/FilamentAlertsServiceProvider.php index 9f43301..e5deeb3 100644 --- a/src/FilamentAlertsServiceProvider.php +++ b/src/FilamentAlertsServiceProvider.php @@ -57,17 +57,17 @@ public function boot(): void { FilamentSettingsHub::register([ SettingHold::make() - ->label('Firebase Settings') + ->label('filament-alerts::messages.settings.firebase.title') ->icon('heroicon-o-fire') ->route('filament.admin.pages.notifications-settings-page') - ->description('Update Firebase Settings') - ->group('Notifications'), + ->description('filament-alerts::messages.settings.firebase.description') + ->group('filament-alerts::messages.settings.group'), SettingHold::make() - ->label('Email Settings') + ->label('filament-alerts::messages.settings.email.title') ->icon('heroicon-o-envelope') ->route('filament.admin.pages.email-settings-page') - ->description('Update Email Provider Settings') - ->group('Notifications'), + ->description('filament-alerts::messages.settings.email.description') + ->group('filament-alerts::messages.settings.group'), ]); diff --git a/src/Pages/EmailSettingsPage.php b/src/Pages/EmailSettingsPage.php index 60fd5b5..aafcd89 100644 --- a/src/Pages/EmailSettingsPage.php +++ b/src/Pages/EmailSettingsPage.php @@ -32,7 +32,7 @@ public function getTitle(): string protected function getActions(): array { return [ - Action::make('back')->action(fn()=> redirect()->route('filament.admin.pages.settings-hub'))->color('danger')->label(trans('filament-settings-hub::messages.back')), + Action::make('back')->action(fn()=> redirect()->route('filament.admin.pages.settings-hub'))->color('danger')->label(trans('filament-alerts::messages.back')), ]; } @@ -46,29 +46,29 @@ protected function getFormSchema(): array return [ Grid::make(['default' => 1])->schema([ TextInput::make('mail_mailer') - ->label(trans('filament-settings-hub::messages.settings.mail_mailer')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_mailer")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_mailer')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_mailer")': null), TextInput::make('mail_host') - ->label(trans('filament-settings-hub::messages.settings.mail_host')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_host")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_host')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_host")': null), TextInput::make('mail_port') - ->label(trans('filament-settings-hub::messages.settings.mail_port')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_port")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_port')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_port")': null), TextInput::make('mail_username') - ->label(trans('filament-settings-hub::messages.settings.mail_username')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_username")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_username')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_username")': null), TextInput::make('mail_password') - ->label(trans('filament-settings-hub::messages.settings.mail_password')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_password")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_password')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_password")': null), TextInput::make('mail_encryption') - ->label(trans('filament-settings-hub::messages.settings.mail_encryption')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_encryption")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_encryption')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_encryption")': null), TextInput::make('mail_from_address') - ->label(trans('filament-settings-hub::messages.settings.mail_from_address')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_from_address")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_from_address')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_from_address")': null), TextInput::make('mail_from_name') - ->label(trans('filament-settings-hub::messages.settings.mail_from_name')) - ->hint(config('filament-settings-hub.show_hint') ?'setting("mail_from_name")': null), + ->label(trans('filament-alerts::messages.settings.email.mail_from_name')) + ->hint(config('filament-alerts.show_hint') ?'setting("mail_from_name")': null), ]) ]; diff --git a/src/Pages/NotificationsSettingsPage.php b/src/Pages/NotificationsSettingsPage.php index bb73c94..b3798e2 100644 --- a/src/Pages/NotificationsSettingsPage.php +++ b/src/Pages/NotificationsSettingsPage.php @@ -25,7 +25,7 @@ class NotificationsSettingsPage extends SettingsPage public function getTitle(): string { - return trans('filament-alerts::messages.settings.notifications.title'); + return trans('filament-alerts::messages.settings.firebase.title'); } protected function getActions(): array @@ -45,37 +45,37 @@ protected function getFormSchema(): array return [ Grid::make(['default' => 1])->schema([ Checkbox::make('notifications_allow') - ->label(trans('filament-settings-hub::messages.settings.notifications_allow')) + ->label(trans('filament-alerts::messages.settings.firebase.notifications_allow')) ->hint(config('filament-settings-hub.show_hint') ?'setting("notifications_allow")': null), TextInput::make('fcm_apiKey') - ->label(trans('filament-settings-hub::messages.settings.fcm_apiKey')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_apiKey')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_apiKey")': null), TextInput::make('fcm_authDomain') - ->label(trans('filament-settings-hub::messages.settings.fcm_authDomain')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_authDomain')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_authDomain")': null), TextInput::make('fcm_projectId') - ->label(trans('filament-settings-hub::messages.settings.fcm_projectId')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_projectId')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_projectId")': null), TextInput::make('fcm_storageBucket') - ->label(trans('filament-settings-hub::messages.settings.fcm_storageBucket')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_storageBucket')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_storageBucket")': null), TextInput::make('fcm_messagingSenderId') - ->label(trans('filament-settings-hub::messages.settings.fcm_messagingSenderId')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_messagingSenderId')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_messagingSenderId")': null), TextInput::make('fcm_appId') - ->label(trans('filament-settings-hub::messages.settings.fcm_appId')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_appId')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_appId")': null), TextInput::make('fcm_measurementId') - ->label(trans('filament-settings-hub::messages.settings.fcm_measurementId')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_measurementId')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_measurementId")': null), FileUpload::make('fcm_cr') - ->label(trans('filament-settings-hub::messages.settings.fcm_cr')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_cr')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_cr")': null), TextInput::make('fcm_database_url') - ->label(trans('filament-settings-hub::messages.settings.fcm_database_url')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_database_url')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_database_url")': null), TextInput::make('fcm_vapid') - ->label(trans('filament-settings-hub::messages.settings.fcm_vapid')) + ->label(trans('filament-alerts::messages.settings.firebase.fcm_vapid')) ->hint(config('filament-settings-hub.show_hint') ?'setting("fcm_vapid")': null), ])