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

View File

@@ -1,6 +1,6 @@
APP_NAME=Laravel APP_NAME=Laravel
APP_ENV=local APP_ENV=local
APP_KEY=base64:pmWS5U7+noTCU5suzjqHJ6JLy97iftEZhwvX+pEZKKs= APP_KEY=base64:YxwN4ge+hJYN/J9RTxCcgUdPZ3zBMUVWmzU71vwjU9Y=
APP_DEBUG=true APP_DEBUG=true
APP_URL=http://localhost APP_URL=http://localhost
APP_DEMO=false APP_DEMO=false

View File

@@ -11,7 +11,7 @@ return [
'plan_description' => 'Plan description', 'plan_description' => 'Plan description',
'type_plan_name' => 'Type plan name', 'type_plan_name' => 'Type plan name',
'plan_name' => 'Plan name', 'plan_name' => 'Plan name',
'plan_price' => 'Plan price', 'plan_price' => 'Plan price',
'admin_page_plans.form.status_help' => 'Status of your plan availability on website.', 'admin_page_plans.form.status_help' => 'Status of your plan availability on website.',
'admin_page_plans.form.storage' => 'Storage Capacity in GB', 'admin_page_plans.form.storage' => 'Storage Capacity in GB',
'admin_page_plans.form.storage_helper' => "You have to type only number e.g. value '5' means, user will have 5GB of storage capacity.", 'admin_page_plans.form.storage_helper' => "You have to type only number e.g. value '5' means, user will have 5GB of storage capacity.",
@@ -228,6 +228,42 @@ return [
'interval.year' => 'Yearly', 'interval.year' => 'Yearly',
'interval.month' => 'Monthly', 'interval.month' => 'Monthly',
'subscriptions' => 'Subscriptions', 'subscriptions' => 'Subscriptions',
'show_billing' => 'Show Billing',
'billing_alert_reached_short' => 'Billing Alert Reached!',
'billing_alert_reached_short_note' => 'The billing alert you set previously has been reached. Please revise your spending.',
'billing_alert_reached_long' => 'Your billing alert has been reached!',
'billing_alert_reached_long_note' => 'The billing alert you set previously has been reached. Please go to your user account and revise your spending',
'you_received_bonus' => 'You Received {bonus}',
'you_received_bonus_note' => 'You received credit bonus {bonus} from us. Happy spending!',
'you_received_registration_bonus_note' => 'You received credit bonus {bonus} for your registration. Happy spending!',
'withdrawal_failed_short' => 'Withdrawal Failed',
'withdrawal_failed_short_note' => "Your credit withdrawal for your account didn't go through. Please make sure you have sufficient funds on your account.",
'withdrawal_failed_long' => 'Uh-oh! Your credit withdrawal for your pre-paid subscription failed',
'withdrawal_failed_long_note' => "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!",
'fund_your_account' => 'Fund Your Account',
'subscription_created_short' => 'Subscription Has Been Created',
'subscription_created_short_note' => 'Your subscription {plan} has been successfully created',
'subscription_created_long' => 'Your subscription {plan} has been successfully created',
'subscription_created_long_note' => 'You have been successfully subscribed to your {plan} subscription. Now you can take full advantage of our platform.',
'go_to_subscription' => 'Go to Subscription',
'charge_from_card_failed_subject' => 'Uh-oh! Your withdrawal from your credit card for pre-paid subscription failed',
'charge_from_card_failed_line' => "It looks like withdrawal from your credit card for pre-paid subscription for your account didn't go through. Please check your credit card or register new credit card for your account and we'll give it another try!",
'charge_from_card_failed_action' => 'Go to Billing Settings',
'charge_from_card_failed_again_subject' => 'Uh-oh! Your withdrawal from your credit card for pre-paid subscription failed once again',
'charge_from_card_failed_again_line' => "It looks like withdrawal from your credit card for pre-paid subscription for your account didn't go through once again. Please check your credit card or register new credit card for your account and we'll give it another try!",
'charge_from_card_failed_again_action' => 'Update Your Payment Information',
'confirm_payment' => 'Confirm Payment',
'confirm_payment_greeting' => 'Confirm your {amount} payment',
'confirm_payment_line' => 'Extra confirmation is needed to process your payment. Please continue to the payment page by clicking on the button below.',
'confirm_payment_action' => 'Confirm Payment',
'registration_bonus' => 'Registration Bonus',
'number' => 'Number',
'head_office' => 'Head Office',
'vat_id' => 'VAT ID',
'date_of_issue' => 'Date of issue',
'period' => 'Period',
'Description' => 'description',
'generated_by' => 'Generated by',
], ],
'regular' => [ 'regular' => [
'type' => 'Type', 'type' => 'Type',
@@ -660,6 +696,7 @@ return [
'upload_folder' => 'Upload Folder', 'upload_folder' => 'Upload Folder',
'member' => 'Members', 'member' => 'Members',
'request_for_upload' => '{name} is Asking You For Files', 'request_for_upload' => '{name} is Asking You For Files',
'upload_request' => 'Upload Request',
'request_for_upload_success' => 'Upload Request for {name} was Fulfilled Successfully', 'request_for_upload_success' => 'Upload Request for {name} was Fulfilled Successfully',
'request_for_upload_expired' => 'Upload Request Expired', 'request_for_upload_expired' => 'Upload Request Expired',
'automatically_uploads_for_file_request' => 'Your files will be uploaded automatically and after that, you can organize your files in folders.', 'automatically_uploads_for_file_request' => 'Your files will be uploaded automatically and after that, you can organize your files in folders.',
@@ -825,7 +862,6 @@ return [
'update_profile_settings' => 'Update Profile Settings', 'update_profile_settings' => 'Update Profile Settings',
'update_security_api' => 'Update Security & API', 'update_security_api' => 'Update Security & API',
'show_storage_details' => 'Show Storage Details', 'show_storage_details' => 'Show Storage Details',
'show_billing' => 'Show Billing',
'empty_your_trash' => 'Empty Your Trash', 'empty_your_trash' => 'Empty Your Trash',
'toggle_grid_list_view' => 'Toggle Grid/List View', 'toggle_grid_list_view' => 'Toggle Grid/List View',
'toggle_dark_light_mode' => 'Toggle Dark/Light Mode', 'toggle_dark_light_mode' => 'Toggle Dark/Light Mode',
@@ -864,8 +900,31 @@ return [
'active' => 'Active', 'active' => 'Active',
'archived' => 'Archived', 'archived' => 'Archived',
'inactive' => 'Inactive', 'inactive' => 'Inactive',
'total_x_of_x_used' => 'Total ${use} of ${total} Used', 'total_x_of_x_used' => 'Total ${use} of ${total} Used',
'total_x_of_x_members' => 'Total ${use} of ${total} Members', 'total_x_of_x_members' => 'Total ${use} of ${total} Members',
'go_back_from_x' => 'Go back from {location}', 'go_back_from_x' => 'Go back from {location}',
'new_team_invitation' => 'New Team Invitation',
'x_invite_to_join_team' => "{name} invite you to join into Team Folder.",
'team_invitation_notify_title' => 'You are invited to collaboration with team folder in {app}',
'team_invitation_notify_desc' => 'You are invited to collaboration with team folder',
'team_invitation_notify_desc_without_account' => 'You are invited to collaboration with team folder. But at first, you have to create an account to proceed into team folder.',
'join_into_team_folder' => 'Join into Team Folder',
'join_and_create_account' => 'Join & Create an Account',
'file_request_filled' => 'File Request Filled',
'file_request_filled_desc' => "Your file request for '{name}' folder was filled successfully.",
'show_files' => 'Show Files',
'file_request_filled_mail' => "Your file request was fulfilled in your '{name}' folder",
'file_request_filled_mail_note' => "We are emailing you because your file request was fulfilled. Please click on the link below to show uploaded files.",
'thanks_salutation' => 'Thank you for using our application!',
'upload_your_files' => 'Upload your Files',
'file_request_optional_message' => "PS: {name} left you a message: {notes}",
'file_request_notify_title' => '{name} Request You for File Upload',
'file_request_notify_description' => "We are emailing you because {name} requested files from you. Please click on the link below and upload your files for {name}.",
'user_action_not_allowed' => 'This user action is not allowed.',
'pcs.' => 'Pcs.',
'mem.' => 'Mem.',
'password_doesnt_match' => 'The provided password does not match your current password.',
'amount' => 'Amount',
'upload_request_default_folder' => 'Upload Request from {timestamp}',
], ],
]; ];

View File

@@ -23,11 +23,11 @@ return [
], ],
'notifications' => [ 'notifications' => [
'ChargeFromCreditCardFailedAgainNotification' => \VueFileManager\Subscription\Domain\FailedPayments\Notifications\ChargeFromCreditCardFailedAgainNotification::class, 'ChargeFromCreditCardFailedAgainNotification' => \Domain\Subscriptions\Notifications\ChargeFromCreditCardFailedAgainNotification::class,
'ChargeFromCreditCardFailedNotification' => \VueFileManager\Subscription\Domain\FailedPayments\Notifications\ChargeFromCreditCardFailedNotification::class, 'ChargeFromCreditCardFailedNotification' => \Domain\Subscriptions\Notifications\ChargeFromCreditCardFailedNotification::class,
'ConfirmStripePaymentNotification' => \VueFileManager\Subscription\Support\Miscellaneous\Stripe\Notifications\ConfirmStripePaymentNotification::class,
'SubscriptionWasCreatedNotification' => \Domain\Subscriptions\Notifications\SubscriptionWasCreatedNotification::class, 'SubscriptionWasCreatedNotification' => \Domain\Subscriptions\Notifications\SubscriptionWasCreatedNotification::class,
'BillingAlertTriggeredNotification' => \Domain\Subscriptions\Notifications\BillingAlertTriggeredNotification::class, 'BillingAlertTriggeredNotification' => \Domain\Subscriptions\Notifications\BillingAlertTriggeredNotification::class,
'ConfirmStripePaymentNotification' => \Domain\Subscriptions\Notifications\ConfirmStripePaymentNotification::class,
'InsufficientBalanceNotification' => \Domain\Subscriptions\Notifications\InsufficientBalanceNotification::class, 'InsufficientBalanceNotification' => \Domain\Subscriptions\Notifications\InsufficientBalanceNotification::class,
'BonusCreditAddedNotification' => \Domain\Subscriptions\Notifications\BonusCreditAddedNotification::class, 'BonusCreditAddedNotification' => \Domain\Subscriptions\Notifications\BonusCreditAddedNotification::class,
], ],

View File

@@ -68,7 +68,7 @@
{{ __t('invoice') }} {{ __t('invoice') }}
</h1> </h1>
<b class="text-gray-800 text-sm"> <b class="text-gray-800 text-sm">
Number: {{ $invoice->id }} {{ __t('number') }}: {{ $invoice->id }}
</b> </b>
</div> </div>
</header> </header>
@@ -91,7 +91,7 @@
<div class="mb-3"> <div class="mb-3">
<b class="text-theme text-base font-bold mb-1 block"> <b class="text-theme text-base font-bold mb-1 block">
Head Office: {{ __t('head_office') }}:
</b> </b>
@isset($settings->billing_address) @isset($settings->billing_address)
@@ -133,12 +133,12 @@
<div> <div>
<b class="text-theme text-base font-bold mb-1 block"> <b class="text-theme text-base font-bold mb-1 block">
Billing Information: {{ __t('billing_information') }}:
</b> </b>
@isset($settings->billing_vat_number) @isset($settings->billing_vat_number)
<span class="font-bold block"> <span class="font-bold block">
VAT ID: {{ $settings->billing_vat_number }} {{ __t('vat_id') }}: {{ $settings->billing_vat_number }}
</span> </span>
@endisset @endisset
@@ -154,7 +154,7 @@
<div> <div>
<div class="bg-light-background rounded-xl p-4" style="width: 360px"> <div class="bg-light-background rounded-xl p-4" style="width: 360px">
<b class="text-theme text-base font-bold mb-1.5 block"> <b class="text-theme text-base font-bold mb-1.5 block">
Client: {{ __t('client') }}:
</b> </b>
@isset($invoice->user->settings->name) @isset($invoice->user->settings->name)
@@ -200,7 +200,7 @@
@endisset @endisset
</div> </div>
<div class="font-bold block lg:text-right print:text-right pt-3 text-sm"> <div class="font-bold block lg:text-right print:text-right pt-3 text-sm">
Date of issue: {{ format_date($invoice->created_at) }} {{ __t('date_of_issue') }}: {{ format_date($invoice->created_at) }}
</div> </div>
</div> </div>
</div> </div>
@@ -214,22 +214,22 @@
<tr> <tr>
<td class="pb-5"> <td class="pb-5">
<span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold"> <span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold">
Description {{ __t('description') }}
</span> </span>
</td> </td>
<td class="pb-5"> <td class="pb-5">
<span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold"> <span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold">
Period {{ __t('period') }}
</span> </span>
</td> </td>
<td class="pb-5"> <td class="pb-5">
<span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold"> <span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold">
Usage {{ __t('usage') }}
</span> </span>
</td> </td>
<td class="pb-5 text-right"> <td class="pb-5 text-right">
<span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold"> <span class="text-theme dark:text-gray-500 text-gray-400 text-xs font-bold">
Amount {{ __t('amount') }}
</span> </span>
</td> </td>
</tr> </tr>
@@ -266,7 +266,7 @@
<tr class="whitespace-nowrap"> <tr class="whitespace-nowrap">
<td class="py-1.5 pr-3"> <td class="py-1.5 pr-3">
<span class="text-sm font-bold"> <span class="text-sm font-bold">
Subscription {{ __t('subscription') }}
</span> </span>
</td> </td>
<td class="py-1.5"> <td class="py-1.5">
@@ -299,7 +299,7 @@
<!-- Invoice Items --> <!-- Invoice Items -->
<footer class="text-center"> <footer class="text-center">
<p class="font-bold"> <p class="font-bold">
Generated by <a href="{{ url('/') }}" target="_blank" class="font-bold text-theme underline">{{ $settings->app_title }}</a> {{ __t('generated_by') }} <a href="{{ url('/') }}" target="_blank" class="font-bold text-theme underline">{{ $settings->app_title }}</a>
</p> </p>
</footer> </footer>
</div> </div>

View File

@@ -33,7 +33,7 @@ class AutoSubscribeForMeteredBillingAction
'status' => 'completed', 'status' => 'completed',
'type' => 'credit', 'type' => 'credit',
'driver' => 'system', 'driver' => 'system',
'note' => __('Registration Bonus'), 'note' => __t('registration_bonus'),
'currency' => $plan->currency, 'currency' => $plan->currency,
'amount' => $settings['registration_bonus_amount'], 'amount' => $settings['registration_bonus_amount'],
]); ]);

View File

@@ -13,8 +13,8 @@ class FormatUsageEstimatesAction
// Format usage // Format usage
$usage = match ($estimate['feature']) { $usage = match ($estimate['feature']) {
'bandwidth', 'storage' => Metric::megabytes($estimate['usage'] * 1000)->format(), 'bandwidth', 'storage' => Metric::megabytes($estimate['usage'] * 1000)->format(),
'flatFee' => intval($estimate['usage']) . ' ' . __('Pcs.'), 'flatFee' => intval($estimate['usage']) . ' ' . __t('pcs.'),
'member' => intval($estimate['usage']) . ' ' . __('Mem.'), 'member' => intval($estimate['usage']) . ' ' . __t('mem.'),
}; };
return [ return [

View File

@@ -1,6 +1,8 @@
<?php <?php
namespace App\Users\Actions; namespace App\Users\Actions;
use App\Users\Rules\PasswordValidationRules;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\UpdatesUserPasswords; use Laravel\Fortify\Contracts\UpdatesUserPasswords;
@@ -23,8 +25,8 @@ class UpdateUserPassword implements UpdatesUserPasswords
'current_password' => ['required', 'string'], 'current_password' => ['required', 'string'],
'password' => $this->passwordRules(), 'password' => $this->passwordRules(),
])->after(function ($validator) use ($user, $input) { ])->after(function ($validator) use ($user, $input) {
if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) { if (!isset($input['current_password']) || !Hash::check($input['current_password'], $user->password)) {
$validator->errors()->add('current_password', __('The provided password does not match your current password.')); $validator->errors()->add('current_password', __t('password_doesnt_match'));
} }
})->validateWithBag('updatePassword'); })->validateWithBag('updatePassword');

View File

@@ -5,6 +5,12 @@ use Exception;
class InvalidUserActionException extends Exception class InvalidUserActionException extends Exception
{ {
// TODO: translate public $message = 'This user action is not allowed.';
protected $message = 'This user action is not allowed.';
public function __construct()
{
parent::__construct();
$this->message = __t('user_action_not_allowed');
}
} }

View File

@@ -34,8 +34,8 @@ class RegistrationBonusAddedNotification extends Notification implements ShouldQ
{ {
return [ return [
'category' => 'gift', 'category' => 'gift',
'title' => "You Received {$this->bonus}", 'title' => __t('you_received_bonus', ['bonus' => $this->bonus]),
'description' => "You received credit bonus $this->bonus for your registration. Happy spending!", 'description' => __t('you_received_registration_bonus_note', ['bonus' => $this->bonus]),
]; ];
} }
} }

View File

@@ -39,21 +39,21 @@ class NavigationTreeController
return [ return [
[ [
'location' => 'files', 'location' => 'files',
'name' => 'Files', 'name' => __t('menu.files'),
'folders' => $folders, 'folders' => $folders,
'isMovable' => true, 'isMovable' => true,
'isOpen' => true, 'isOpen' => true,
], ],
[ [
'location' => 'team-folders', 'location' => 'team-folders',
'name' => 'Team Folders', 'name' => __t('team_folders'),
'folders' => $teamFolders, 'folders' => $teamFolders,
'isMovable' => false, 'isMovable' => false,
'isOpen' => false, 'isOpen' => false,
], ],
[ [
'location' => 'shared-with-me', 'location' => 'shared-with-me',
'name' => 'Shared With Me', 'name' => __t('shared_with_me'),
'folders' => $sharedWithMeFolders, 'folders' => $sharedWithMeFolders,
'isMovable' => false, 'isMovable' => false,
'isOpen' => false, 'isOpen' => false,

View File

@@ -24,7 +24,7 @@ class SeedDefaultLanguageTranslationsAction
$translations = $translations[strtolower($license)] $translations = $translations[strtolower($license)]
->map(fn ($value, $key) => [ ->map(fn ($value, $key) => [
'lang' => $locale, 'lang' => $locale,
'value' => $value, 'value' => '____',
'key' => $key, 'key' => $key,
])->toArray(); ])->toArray();

View File

@@ -18,23 +18,23 @@ class BillingAlertTriggeredNotification extends Notification implements ShouldQu
public function toMail(): MailMessage public function toMail(): MailMessage
{ {
return (new MailMessage) return (new MailMessage)
->subject(__('Your billing alert has been reached!')) ->subject(__t('billing_alert_reached_long'))
->greeting(__('Hi there')) ->greeting(__t('hello'))
->line(__('The billing alert you set previously has been reached. Please go to your user account and revise your spending')) ->line(__t('billing_alert_reached_long_note'))
->action(__('Show Billing'), url('/user/settings/billing')); ->action(__t('show_billing'), url('/user/settings/billing'));
} }
public function toArray(): array public function toArray(): array
{ {
return [ return [
'category' => 'billing-alert', 'category' => 'billing-alert',
'title' => 'billing Alert Reached!', 'title' => __t('billing_alert_reached_short'),
'description' => 'The billing alert you set previously has been reached. Please revise your spending.', 'description' => __t('billing_alert_reached_short_note'),
'action' => [ 'action' => [
'type' => 'route', 'type' => 'route',
'params' => [ 'params' => [
'route' => 'Billing', 'route' => __t('billing'),
'button' => 'Show Billing', 'button' => __t('show_billing'),
], ],
], ],
]; ];

View File

@@ -34,8 +34,8 @@ class BonusCreditAddedNotification extends Notification implements ShouldQueue
{ {
return [ return [
'category' => 'gift', 'category' => 'gift',
'title' => "You Received {$this->bonus}", 'title' => __t('you_received_bonus', ['bonus' => $this->bonus]),
'description' => "You received credit bonus $this->bonus from us. Happy spending!", 'description' => __t('you_received_bonus_note', ['bonus' => $this->bonus]),
]; ];
} }
} }

View File

@@ -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'));
}
}

View File

@@ -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'));
}
}

View File

@@ -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']);
}
}

View File

@@ -18,23 +18,23 @@ class InsufficientBalanceNotification extends Notification implements ShouldQueu
public function toMail(): MailMessage public function toMail(): MailMessage
{ {
return (new MailMessage) return (new MailMessage)
->subject(__('Uh-oh! Your credit withdrawal for your pre-paid subscription failed')) ->subject(__t('withdrawal_failed_long'))
->greeting(__('Hi there')) ->greeting(__t('hello'))
->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!")) ->line(__t('withdrawal_failed_long_note'))
->action(__('Fund Your Account'), url('/user/settings/billing')); ->action(__t('fund_your_account'), url('/user/settings/billing'));
} }
public function toArray(): array public function toArray(): array
{ {
return [ return [
'category' => 'insufficient-balance', 'category' => 'insufficient-balance',
'title' => 'Withdrawal failed', 'title' => __t('withdrawal_failed_short'),
'description' => "Your credit withdrawal for your account didn't go through. Please make sure you have sufficient funds on your account.", 'description' => __t('withdrawal_failed_short_note'),
'action' => [ 'action' => [
'type' => 'route', 'type' => 'route',
'params' => [ 'params' => [
'route' => 'Billing', 'route' => __t('billing'),
'button' => 'Show Billing', 'button' => __t('show_billing'),
], ],
], ],
]; ];

View File

@@ -24,23 +24,23 @@ class SubscriptionWasCreatedNotification extends Notification implements ShouldQ
public function toMail(): MailMessage public function toMail(): MailMessage
{ {
return (new MailMessage) return (new MailMessage)
->subject(__("Your subscription {$this->subscription->plan->name} has been successfully created")) ->subject(__t('subscription_created_long', ['plan' => $this->subscription->plan->name]))
->greeting(__('Hi there')) ->greeting(__t('hello'))
->line(__("You have been successfully subscribed to your {$this->subscription->plan->name} subscription. Now you can take full advantage of our platform.")) ->line(__t('subscription_created_long_note', ['plan' => $this->subscription->plan->name]))
->action(__('Go to Subscription'), url('/user/settings/billing')); ->action(__t('go_to_subscription'), url('/user/settings/billing'));
} }
public function toArray(): array public function toArray(): array
{ {
return [ return [
'category' => 'subscription-created', 'category' => 'subscription-created',
'title' => 'Subscription Has Been Created', 'title' => __t('subscription_created_short'),
'description' => "Your subscription {$this->subscription->plan->name} has been successfully created", 'description' => __t('subscription_created_short_note', ['plan' => $this->subscription->plan->name]),
'action' => [ 'action' => [
'type' => 'route', 'type' => 'route',
'params' => [ 'params' => [
'route' => 'Billing', 'route' => __t('billing'),
'button' => 'Show Billing', 'button' => __t('show_billing'),
], ],
], ],
]; ];

View File

@@ -38,19 +38,19 @@ class InvitationIntoTeamFolder extends Notification implements ShouldQueue
if ($user) { if ($user) {
return (new MailMessage) return (new MailMessage)
->subject("You are invited to collaboration with team folder in $appTitle") ->subject(__t('team_invitation_notify_title', ['app' => $appTitle]))
->greeting('Hello!') ->greeting(__t('hello'))
->line('You are invited to collaboration with team folder') ->line(__t('team_invitation_notify_desc'))
->action('Join into Team Folder', url('/team-folder-invitation', ['id' => $this->invitation->id])) ->action(__t('join_into_team_folder'), url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation("Regards, $appTitle"); ->salutation(__t('salutation') . ', ' . $appTitle);
} }
return (new MailMessage) return (new MailMessage)
->subject("You are invited to collaboration with team folder in $appTitle") ->subject(__t('team_invitation_notify_title', ['app' => $appTitle]))
->greeting('Hello!') ->greeting(__t('hello'))
->line('You are invited to collaboration with team folder. But at first, you have to create an account to proceed into team folder.') ->line(__t('team_invitation_notify_desc_without_account'))
->action('Join & Create an Account', url('/team-folder-invitation', ['id' => $this->invitation->id])) ->action(__t('join_and_create_account'), url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation("Regards, $appTitle"); ->salutation(__t('salutation') . ', ' . $appTitle);
} }
/** /**
@@ -60,8 +60,8 @@ class InvitationIntoTeamFolder extends Notification implements ShouldQueue
{ {
return [ return [
'category' => 'team-invitation', 'category' => 'team-invitation',
'title' => 'New Team Invitation', 'title' => __t('new_team_invitation'),
'description' => "{$this->invitation->inviter->settings->name} invite you to join into Team Folder.", 'description' => __t('x_invite_to_join_team', ['name' => $this->invitation->inviter->settings->name,]),
'action' => [ 'action' => [
'type' => 'invitation', 'type' => 'invitation',
'params' => [ 'params' => [

View File

@@ -21,7 +21,7 @@ class GetFolderTreeForUploadRequestController extends Controller
return [ return [
[ [
'name' => 'Upload Request', // Todo: translate 'name' => __t('upload_request'),
'location' => 'upload-request', 'location' => 'upload-request',
'folders' => $folders, 'folders' => $folders,
'isMovable' => true, 'isMovable' => true,

View File

@@ -60,14 +60,14 @@ class UploadFilesForUploadRequestController
private function createFolder(UploadRequest $uploadRequest): void private function createFolder(UploadRequest $uploadRequest): void
{ {
// Format timestamp // Format timestamp
$timestampName = format_date($uploadRequest->created_at, 'd. M. Y'); $timestamp = format_date($uploadRequest->created_at, 'd. M. Y');
// Create folder // Create folder
DB::table('folders')->insert([ DB::table('folders')->insert([
'id' => $uploadRequest->id, 'id' => $uploadRequest->id,
'parent_id' => $uploadRequest->folder_id ?? null, 'parent_id' => $uploadRequest->folder_id ?? null,
'user_id' => $uploadRequest->user_id, '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(), 'created_at' => now(),
'updated_at' => now(), 'updated_at' => now(),
]); ]);

View File

@@ -1,4 +1,5 @@
<?php <?php
namespace Domain\UploadRequest\Notifications; namespace Domain\UploadRequest\Notifications;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
@@ -18,8 +19,7 @@ class UploadRequestFulfilledNotification extends Notification implements ShouldQ
*/ */
public function __construct( public function __construct(
public UploadRequest $uploadRequest public UploadRequest $uploadRequest
) { ) {}
}
/** /**
* Get the notification's delivery channels. * Get the notification's delivery channels.
@@ -34,13 +34,12 @@ class UploadRequestFulfilledNotification extends Notification implements ShouldQ
*/ */
public function toMail(mixed $notifiable): MailMessage public function toMail(mixed $notifiable): MailMessage
{ {
// TODO: add to language strings
return (new MailMessage) return (new MailMessage)
->subject("Your file request was fulfilled in your '{$this->uploadRequest->parent->name}' folder") ->subject(__t('file_request_filled_mail', ['name' => $this->uploadRequest->parent->name]))
->greeting('Hello') ->greeting(__t('hello'))
->line('We are emailing you because your file request was fulfilled. Please click on the link below to show uploaded files.') ->line(__t('file_request_filled_mail_note'))
->action('Show Files', url("/platform/files/{$this->uploadRequest->id}")) ->action(__t('show_files'), url("/platform/files/{$this->uploadRequest->id}"))
->line('Thank you for using our application!'); ->salutation(__t('thanks_salutation'));
} }
/** /**
@@ -50,13 +49,13 @@ class UploadRequestFulfilledNotification extends Notification implements ShouldQ
{ {
return [ return [
'category' => 'file-request', 'category' => 'file-request',
'title' => 'File Request Filled', 'title' => __t('file_request_filled'),
'description' => "Your file request for '{$this->uploadRequest->parent->name}' folder was filled successfully.", 'description' => __t('file_request_filled_desc', ['name' => $this->uploadRequest->parent->name,]),
'action' => [ 'action' => [
'type' => 'route', 'type' => 'route',
'params' => [ 'params' => [
'route' => 'Files', 'route' => 'Files',
'button' => 'Show Files', 'button' => __t('show_files'),
'id' => $this->uploadRequest->id, 'id' => $this->uploadRequest->id,
], ],
], ],

View File

@@ -41,19 +41,17 @@ class UploadRequestNotification extends Notification implements ShouldQueue
public function toMail($notifiable) public function toMail($notifiable)
{ {
// Format optional message // Format optional message
// TODO: add to language strings
$message = $this->uploadRequest->notes $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; : null;
// TODO: add to language strings
return (new MailMessage) return (new MailMessage)
->subject("{$this->uploadRequest->user->settings->first_name} Request You for File Upload") ->subject(__t('file_request_notify_title', ['name' => $this->uploadRequest->user->settings->first_name]))
->greeting('Hello') ->greeting(__t('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}.") ->line(__t('file_request_notify_description', ['name' => $this->uploadRequest->user->settings->first_name]))
->line($message) ->line($message)
->action('Upload your Files', url("/request/{$this->uploadRequest->id}/upload")) ->action(__t('upload_your_files'), url("/request/{$this->uploadRequest->id}/upload"))
->line('Thank you for using our application!'); ->salutation(__t('thanks_salutation'));
} }
/** /**

View File

@@ -110,12 +110,12 @@ class UserSubscriptionTest extends TestCase
$usages = collect([ $usages = collect([
[ [
'feature' => 'bandwidth', 'feature' => 'bandwidth',
'amount' => 7546.96, 'amount' => 7.54696,
'usage' => 26024, 'usage' => 2.6024,
], [ ], [
'feature' => 'storage', 'feature' => 'storage',
'amount' => 476.28, 'amount' => 0.47628,
'usage' => 3969, 'usage' => 3.969,
], [ ], [
'feature' => 'flatFee', 'feature' => 'flatFee',
'amount' => 2.49, 'amount' => 2.49,
@@ -136,7 +136,7 @@ class UserSubscriptionTest extends TestCase
'feature' => 'bandwidth', 'feature' => 'bandwidth',
'amount' => 7.54696, 'amount' => 7.54696,
'cost' => '$7.55', 'cost' => '$7.55',
'usage' => '26.02GB', 'usage' => '2.60GB',
], ],
'storage' => [ 'storage' => [
'feature' => 'storage', 'feature' => 'storage',

View File

@@ -121,7 +121,7 @@ class BrowseTest extends TestCase
], ],
[ [
'location' => 'shared-with-me', 'location' => 'shared-with-me',
'name' => 'Shared With Me', 'name' => 'Shared with Me',
'folders' => [], 'folders' => [],
'isMovable' => false, 'isMovable' => false,
'isOpen' => false, 'isOpen' => false,

View File

@@ -28,12 +28,12 @@ class AppUpgradeTest extends TestCase
DB::table('language_translations') DB::table('language_translations')
->insert([ ->insert([
[ [
'key' => 'activation.stripe.button', 'key' => 'type',
'value' => 'Set up your Stripe account', 'value' => 'Type',
'lang' => $locale, 'lang' => $locale,
], [ ], [
'key' => 'activation.stripe.description', 'key' => 'cancel',
'value' => 'This is original test description', 'value' => 'Cancel',
'lang' => $locale, 'lang' => $locale,
], ],
]); ]);
@@ -47,20 +47,14 @@ class AppUpgradeTest extends TestCase
collect(['en', 'sk']) collect(['en', 'sk'])
->map(function ($locale) { ->map(function ($locale) {
$this->assertDatabaseHas('language_translations', [ $this->assertDatabaseHas('language_translations', [
'key' => 'activation.stripe.title', 'key' => 'close',
'value' => 'Your Stripe account is not set', 'value' => 'Close',
'lang' => $locale, 'lang' => $locale,
]); ]);
$this->assertDatabaseHas('language_translations', [ $this->assertDatabaseHas('language_translations', [
'key' => 'activation.stripe.description', 'key' => 'create_folder',
'value' => 'This is original test description', 'value' => 'Create folder',
'lang' => $locale,
]);
$this->assertDatabaseMissing('language_translations', [
'key' => 'activation.stripe.description',
'value' => 'To charge your users, please set up your Stripe account credentials.',
'lang' => $locale, 'lang' => $locale,
]); ]);
}); });

View File

@@ -72,12 +72,12 @@ class SchedulerTest extends TestCase
->assertDatabaseHas('usages', [ ->assertDatabaseHas('usages', [
'metered_feature_id' => $plan->meteredFeatures()->get()[0]->id, 'metered_feature_id' => $plan->meteredFeatures()->get()[0]->id,
'subscription_id' => $subscription->id, 'subscription_id' => $subscription->id,
'quantity' => 125, 'quantity' => 0.125,
]) ])
->assertDatabaseHas('usages', [ ->assertDatabaseHas('usages', [
'metered_feature_id' => $plan->meteredFeatures()->get()[1]->id, 'metered_feature_id' => $plan->meteredFeatures()->get()[1]->id,
'subscription_id' => $subscription->id, 'subscription_id' => $subscription->id,
'quantity' => 410, 'quantity' => 0.410,
]); ]);
} }