backend language strings updates

This commit is contained in:
Čarodej
2022-03-20 14:26:53 +01:00
parent 881facc867
commit 73ef6e6c1f
27 changed files with 257 additions and 116 deletions
@@ -39,21 +39,21 @@ class NavigationTreeController
return [
[
'location' => 'files',
'name' => 'Files',
'name' => __t('menu.files'),
'folders' => $folders,
'isMovable' => true,
'isOpen' => true,
],
[
'location' => 'team-folders',
'name' => 'Team Folders',
'name' => __t('team_folders'),
'folders' => $teamFolders,
'isMovable' => false,
'isOpen' => false,
],
[
'location' => 'shared-with-me',
'name' => 'Shared With Me',
'name' => __t('shared_with_me'),
'folders' => $sharedWithMeFolders,
'isMovable' => false,
'isOpen' => false,
@@ -24,7 +24,7 @@ class SeedDefaultLanguageTranslationsAction
$translations = $translations[strtolower($license)]
->map(fn ($value, $key) => [
'lang' => $locale,
'value' => $value,
'value' => '____',
'key' => $key,
])->toArray();
@@ -18,23 +18,23 @@ class BillingAlertTriggeredNotification extends Notification implements ShouldQu
public function toMail(): MailMessage
{
return (new MailMessage)
->subject(__('Your billing alert has been reached!'))
->greeting(__('Hi there'))
->line(__('The billing alert you set previously has been reached. Please go to your user account and revise your spending'))
->action(__('Show Billing'), url('/user/settings/billing'));
->subject(__t('billing_alert_reached_long'))
->greeting(__t('hello'))
->line(__t('billing_alert_reached_long_note'))
->action(__t('show_billing'), url('/user/settings/billing'));
}
public function toArray(): array
{
return [
'category' => 'billing-alert',
'title' => 'billing Alert Reached!',
'description' => 'The billing alert you set previously has been reached. Please revise your spending.',
'title' => __t('billing_alert_reached_short'),
'description' => __t('billing_alert_reached_short_note'),
'action' => [
'type' => 'route',
'params' => [
'route' => 'Billing',
'button' => 'Show Billing',
'route' => __t('billing'),
'button' => __t('show_billing'),
],
],
];
@@ -34,8 +34,8 @@ class BonusCreditAddedNotification extends Notification implements ShouldQueue
{
return [
'category' => 'gift',
'title' => "You Received {$this->bonus}",
'description' => "You received credit bonus $this->bonus from us. Happy spending!",
'title' => __t('you_received_bonus', ['bonus' => $this->bonus]),
'description' => __t('you_received_bonus_note', ['bonus' => $this->bonus]),
];
}
}
@@ -0,0 +1,26 @@
<?php
namespace Domain\Subscriptions\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ChargeFromCreditCardFailedAgainNotification extends Notification implements ShouldQueue
{
use Queueable;
public function via(): array
{
return ['mail'];
}
public function toMail(): MailMessage
{
return (new MailMessage)
->subject(__t('charge_from_card_failed_again_subject'))
->greeting(__t('hello'))
->line(__t('charge_from_card_failed_again_line'))
->action(__t('charge_from_card_failed_again_action'), url('/user/settings/billing'));
}
}
@@ -0,0 +1,26 @@
<?php
namespace Domain\Subscriptions\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ChargeFromCreditCardFailedNotification extends Notification implements ShouldQueue
{
use Queueable;
public function via(): array
{
return ['mail'];
}
public function toMail(): MailMessage
{
return (new MailMessage)
->subject(__t('charge_from_card_failed_subject'))
->greeting(__t('hello'))
->line(__t('charge_from_card_failed_line'))
->action(__t('charge_from_card_failed_action'), url('/user/settings/billing'));
}
}
@@ -0,0 +1,31 @@
<?php
namespace Domain\Subscriptions\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ConfirmStripePaymentNotification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
public array $payload
) {
}
public function via(): array
{
return ['mail'];
}
public function toMail(): MailMessage
{
return (new MailMessage)
->subject(__t('confirm_payment'))
->greeting(__t('confirm_payment_greeting', ['amount' => $this->payload['amount']]))
->line(__t('confirm_payment_line'))
->action(__t('confirm_payment_action'), $this->payload['url']);
}
}
@@ -18,23 +18,23 @@ class InsufficientBalanceNotification extends Notification implements ShouldQueu
public function toMail(): MailMessage
{
return (new MailMessage)
->subject(__('Uh-oh! Your credit withdrawal for your pre-paid subscription failed'))
->greeting(__('Hi there'))
->line(__("It looks like your subscription credit withdrawal for your account didn't go through. Please make sure you have sufficient funds on your account and we'll give it another try!"))
->action(__('Fund Your Account'), url('/user/settings/billing'));
->subject(__t('withdrawal_failed_long'))
->greeting(__t('hello'))
->line(__t('withdrawal_failed_long_note'))
->action(__t('fund_your_account'), url('/user/settings/billing'));
}
public function toArray(): array
{
return [
'category' => 'insufficient-balance',
'title' => 'Withdrawal failed',
'description' => "Your credit withdrawal for your account didn't go through. Please make sure you have sufficient funds on your account.",
'title' => __t('withdrawal_failed_short'),
'description' => __t('withdrawal_failed_short_note'),
'action' => [
'type' => 'route',
'params' => [
'route' => 'Billing',
'button' => 'Show Billing',
'route' => __t('billing'),
'button' => __t('show_billing'),
],
],
];
@@ -24,23 +24,23 @@ class SubscriptionWasCreatedNotification extends Notification implements ShouldQ
public function toMail(): MailMessage
{
return (new MailMessage)
->subject(__("Your subscription {$this->subscription->plan->name} has been successfully created"))
->greeting(__('Hi there'))
->line(__("You have been successfully subscribed to your {$this->subscription->plan->name} subscription. Now you can take full advantage of our platform."))
->action(__('Go to Subscription'), url('/user/settings/billing'));
->subject(__t('subscription_created_long', ['plan' => $this->subscription->plan->name]))
->greeting(__t('hello'))
->line(__t('subscription_created_long_note', ['plan' => $this->subscription->plan->name]))
->action(__t('go_to_subscription'), url('/user/settings/billing'));
}
public function toArray(): array
{
return [
'category' => 'subscription-created',
'title' => 'Subscription Has Been Created',
'description' => "Your subscription {$this->subscription->plan->name} has been successfully created",
'title' => __t('subscription_created_short'),
'description' => __t('subscription_created_short_note', ['plan' => $this->subscription->plan->name]),
'action' => [
'type' => 'route',
'params' => [
'route' => 'Billing',
'button' => 'Show Billing',
'route' => __t('billing'),
'button' => __t('show_billing'),
],
],
];
@@ -38,19 +38,19 @@ class InvitationIntoTeamFolder extends Notification implements ShouldQueue
if ($user) {
return (new MailMessage)
->subject("You are invited to collaboration with team folder in $appTitle")
->greeting('Hello!')
->line('You are invited to collaboration with team folder')
->action('Join into Team Folder', url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation("Regards, $appTitle");
->subject(__t('team_invitation_notify_title', ['app' => $appTitle]))
->greeting(__t('hello'))
->line(__t('team_invitation_notify_desc'))
->action(__t('join_into_team_folder'), url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation(__t('salutation') . ', ' . $appTitle);
}
return (new MailMessage)
->subject("You are invited to collaboration with team folder in $appTitle")
->greeting('Hello!')
->line('You are invited to collaboration with team folder. But at first, you have to create an account to proceed into team folder.')
->action('Join & Create an Account', url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation("Regards, $appTitle");
->subject(__t('team_invitation_notify_title', ['app' => $appTitle]))
->greeting(__t('hello'))
->line(__t('team_invitation_notify_desc_without_account'))
->action(__t('join_and_create_account'), url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation(__t('salutation') . ', ' . $appTitle);
}
/**
@@ -60,8 +60,8 @@ class InvitationIntoTeamFolder extends Notification implements ShouldQueue
{
return [
'category' => 'team-invitation',
'title' => 'New Team Invitation',
'description' => "{$this->invitation->inviter->settings->name} invite you to join into Team Folder.",
'title' => __t('new_team_invitation'),
'description' => __t('x_invite_to_join_team', ['name' => $this->invitation->inviter->settings->name,]),
'action' => [
'type' => 'invitation',
'params' => [
@@ -21,7 +21,7 @@ class GetFolderTreeForUploadRequestController extends Controller
return [
[
'name' => 'Upload Request', // Todo: translate
'name' => __t('upload_request'),
'location' => 'upload-request',
'folders' => $folders,
'isMovable' => true,
@@ -60,14 +60,14 @@ class UploadFilesForUploadRequestController
private function createFolder(UploadRequest $uploadRequest): void
{
// Format timestamp
$timestampName = format_date($uploadRequest->created_at, 'd. M. Y');
$timestamp = format_date($uploadRequest->created_at, 'd. M. Y');
// Create folder
DB::table('folders')->insert([
'id' => $uploadRequest->id,
'parent_id' => $uploadRequest->folder_id ?? null,
'user_id' => $uploadRequest->user_id,
'name' => $uploadRequest->name ?? "Upload Request from $timestampName",
'name' => $uploadRequest->name ?? __t('upload_request_default_folder', ['timestamp' => $timestamp]),
'created_at' => now(),
'updated_at' => now(),
]);
@@ -1,4 +1,5 @@
<?php
namespace Domain\UploadRequest\Notifications;
use Illuminate\Bus\Queueable;
@@ -18,8 +19,7 @@ class UploadRequestFulfilledNotification extends Notification implements ShouldQ
*/
public function __construct(
public UploadRequest $uploadRequest
) {
}
) {}
/**
* Get the notification's delivery channels.
@@ -34,13 +34,12 @@ class UploadRequestFulfilledNotification extends Notification implements ShouldQ
*/
public function toMail(mixed $notifiable): MailMessage
{
// TODO: add to language strings
return (new MailMessage)
->subject("Your file request was fulfilled in your '{$this->uploadRequest->parent->name}' folder")
->greeting('Hello')
->line('We are emailing you because your file request was fulfilled. Please click on the link below to show uploaded files.')
->action('Show Files', url("/platform/files/{$this->uploadRequest->id}"))
->line('Thank you for using our application!');
->subject(__t('file_request_filled_mail', ['name' => $this->uploadRequest->parent->name]))
->greeting(__t('hello'))
->line(__t('file_request_filled_mail_note'))
->action(__t('show_files'), url("/platform/files/{$this->uploadRequest->id}"))
->salutation(__t('thanks_salutation'));
}
/**
@@ -50,13 +49,13 @@ class UploadRequestFulfilledNotification extends Notification implements ShouldQ
{
return [
'category' => 'file-request',
'title' => 'File Request Filled',
'description' => "Your file request for '{$this->uploadRequest->parent->name}' folder was filled successfully.",
'title' => __t('file_request_filled'),
'description' => __t('file_request_filled_desc', ['name' => $this->uploadRequest->parent->name,]),
'action' => [
'type' => 'route',
'params' => [
'route' => 'Files',
'button' => 'Show Files',
'button' => __t('show_files'),
'id' => $this->uploadRequest->id,
],
],
@@ -41,19 +41,17 @@ class UploadRequestNotification extends Notification implements ShouldQueue
public function toMail($notifiable)
{
// Format optional message
// TODO: add to language strings
$message = $this->uploadRequest->notes
? "PS: {$this->uploadRequest->user->settings->first_name} left you a message: {$this->uploadRequest->notes}"
? __t('file_request_optional_message', ['name' => $this->uploadRequest->user->settings->first_name, 'notes' => $this->uploadRequest->notes])
: null;
// TODO: add to language strings
return (new MailMessage)
->subject("{$this->uploadRequest->user->settings->first_name} Request You for File Upload")
->greeting('Hello')
->line("We are emailing you because {$this->uploadRequest->user->settings->first_name} requested files from you. Please click on the link below and upload your files for {$this->uploadRequest->user->settings->first_name}.")
->subject(__t('file_request_notify_title', ['name' => $this->uploadRequest->user->settings->first_name]))
->greeting(__t('hello'))
->line(__t('file_request_notify_description', ['name' => $this->uploadRequest->user->settings->first_name]))
->line($message)
->action('Upload your Files', url("/request/{$this->uploadRequest->id}/upload"))
->line('Thank you for using our application!');
->action(__t('upload_your_files'), url("/request/{$this->uploadRequest->id}/upload"))
->salutation(__t('thanks_salutation'));
}
/**