Skip to content

Commit

Permalink
update translations input
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Apr 6, 2024
1 parent 11fcb8e commit bcae8f0
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 35 deletions.
30 changes: 30 additions & 0 deletions resources/lang/ar/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
]
];
30 changes: 30 additions & 0 deletions resources/lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
]
];
12 changes: 6 additions & 6 deletions src/FilamentAlertsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]);


Expand Down
34 changes: 17 additions & 17 deletions src/Pages/EmailSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
];
}

Expand All @@ -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),
])

];
Expand Down
24 changes: 12 additions & 12 deletions src/Pages/NotificationsSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
])

Expand Down

0 comments on commit bcae8f0

Please sign in to comment.