diff --git a/.env.testing b/.env.testing index 0d147e85..8e9e7b74 100644 --- a/.env.testing +++ b/.env.testing @@ -1,6 +1,6 @@ APP_NAME=Laravel APP_ENV=local -APP_KEY=base64:pmWS5U7+noTCU5suzjqHJ6JLy97iftEZhwvX+pEZKKs= +APP_KEY=base64:YxwN4ge+hJYN/J9RTxCcgUdPZ3zBMUVWmzU71vwjU9Y= APP_DEBUG=true APP_URL=http://localhost APP_DEMO=false diff --git a/config/language-translations.php b/config/language-translations.php index 997e2d74..1622346c 100644 --- a/config/language-translations.php +++ b/config/language-translations.php @@ -11,7 +11,7 @@ return [ 'plan_description' => 'Plan description', 'type_plan_name' => 'Type 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.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.", @@ -228,6 +228,42 @@ return [ 'interval.year' => 'Yearly', 'interval.month' => 'Monthly', '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' => [ 'type' => 'Type', @@ -660,6 +696,7 @@ return [ 'upload_folder' => 'Upload Folder', 'member' => 'Members', '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_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.', @@ -825,7 +862,6 @@ return [ 'update_profile_settings' => 'Update Profile Settings', 'update_security_api' => 'Update Security & API', 'show_storage_details' => 'Show Storage Details', - 'show_billing' => 'Show Billing', 'empty_your_trash' => 'Empty Your Trash', 'toggle_grid_list_view' => 'Toggle Grid/List View', 'toggle_dark_light_mode' => 'Toggle Dark/Light Mode', @@ -864,8 +900,31 @@ return [ 'active' => 'Active', 'archived' => 'Archived', 'inactive' => 'Inactive', - 'total_x_of_x_used' => 'Total ${use} of ${total} Used', - 'total_x_of_x_members' => 'Total ${use} of ${total} Members', - 'go_back_from_x' => 'Go back from {location}', + 'total_x_of_x_used' => 'Total ${use} of ${total} Used', + 'total_x_of_x_members' => 'Total ${use} of ${total} Members', + '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}', ], ]; diff --git a/config/subscription.php b/config/subscription.php index bfb58f70..aa4b5cab 100644 --- a/config/subscription.php +++ b/config/subscription.php @@ -23,11 +23,11 @@ return [ ], 'notifications' => [ - 'ChargeFromCreditCardFailedAgainNotification' => \VueFileManager\Subscription\Domain\FailedPayments\Notifications\ChargeFromCreditCardFailedAgainNotification::class, - 'ChargeFromCreditCardFailedNotification' => \VueFileManager\Subscription\Domain\FailedPayments\Notifications\ChargeFromCreditCardFailedNotification::class, - 'ConfirmStripePaymentNotification' => \VueFileManager\Subscription\Support\Miscellaneous\Stripe\Notifications\ConfirmStripePaymentNotification::class, + 'ChargeFromCreditCardFailedAgainNotification' => \Domain\Subscriptions\Notifications\ChargeFromCreditCardFailedAgainNotification::class, + 'ChargeFromCreditCardFailedNotification' => \Domain\Subscriptions\Notifications\ChargeFromCreditCardFailedNotification::class, 'SubscriptionWasCreatedNotification' => \Domain\Subscriptions\Notifications\SubscriptionWasCreatedNotification::class, 'BillingAlertTriggeredNotification' => \Domain\Subscriptions\Notifications\BillingAlertTriggeredNotification::class, + 'ConfirmStripePaymentNotification' => \Domain\Subscriptions\Notifications\ConfirmStripePaymentNotification::class, 'InsufficientBalanceNotification' => \Domain\Subscriptions\Notifications\InsufficientBalanceNotification::class, 'BonusCreditAddedNotification' => \Domain\Subscriptions\Notifications\BonusCreditAddedNotification::class, ], diff --git a/resources/views/vuefilemanager/invoice.blade.php b/resources/views/vuefilemanager/invoice.blade.php index 9533a885..7071e49f 100644 --- a/resources/views/vuefilemanager/invoice.blade.php +++ b/resources/views/vuefilemanager/invoice.blade.php @@ -68,7 +68,7 @@ {{ __t('invoice') }} - Number: {{ $invoice->id }} + {{ __t('number') }}: {{ $invoice->id }} @@ -91,7 +91,7 @@
- Head Office: + {{ __t('head_office') }}: @isset($settings->billing_address) @@ -133,12 +133,12 @@
- Billing Information: + {{ __t('billing_information') }}: @isset($settings->billing_vat_number) - VAT ID: {{ $settings->billing_vat_number }} + {{ __t('vat_id') }}: {{ $settings->billing_vat_number }} @endisset @@ -154,7 +154,7 @@
- Client: + {{ __t('client') }}: @isset($invoice->user->settings->name) @@ -200,7 +200,7 @@ @endisset
- Date of issue: {{ format_date($invoice->created_at) }} + {{ __t('date_of_issue') }}: {{ format_date($invoice->created_at) }}
@@ -214,22 +214,22 @@ - Description + {{ __t('description') }} - Period + {{ __t('period') }} - Usage + {{ __t('usage') }} - Amount + {{ __t('amount') }} @@ -266,7 +266,7 @@ - Subscription + {{ __t('subscription') }} @@ -299,7 +299,7 @@
diff --git a/src/App/Users/Actions/AutoSubscribeForMeteredBillingAction.php b/src/App/Users/Actions/AutoSubscribeForMeteredBillingAction.php index 47893c4e..525172e9 100644 --- a/src/App/Users/Actions/AutoSubscribeForMeteredBillingAction.php +++ b/src/App/Users/Actions/AutoSubscribeForMeteredBillingAction.php @@ -33,7 +33,7 @@ class AutoSubscribeForMeteredBillingAction 'status' => 'completed', 'type' => 'credit', 'driver' => 'system', - 'note' => __('Registration Bonus'), + 'note' => __t('registration_bonus'), 'currency' => $plan->currency, 'amount' => $settings['registration_bonus_amount'], ]); diff --git a/src/App/Users/Actions/FormatUsageEstimatesAction.php b/src/App/Users/Actions/FormatUsageEstimatesAction.php index 1d2fa217..1dc322bc 100644 --- a/src/App/Users/Actions/FormatUsageEstimatesAction.php +++ b/src/App/Users/Actions/FormatUsageEstimatesAction.php @@ -13,8 +13,8 @@ class FormatUsageEstimatesAction // Format usage $usage = match ($estimate['feature']) { 'bandwidth', 'storage' => Metric::megabytes($estimate['usage'] * 1000)->format(), - 'flatFee' => intval($estimate['usage']) . ' ' . __('Pcs.'), - 'member' => intval($estimate['usage']) . ' ' . __('Mem.'), + 'flatFee' => intval($estimate['usage']) . ' ' . __t('pcs.'), + 'member' => intval($estimate['usage']) . ' ' . __t('mem.'), }; return [ diff --git a/src/App/Users/Actions/UpdateUserPassword.php b/src/App/Users/Actions/UpdateUserPassword.php index 36502d1f..3e5b2112 100644 --- a/src/App/Users/Actions/UpdateUserPassword.php +++ b/src/App/Users/Actions/UpdateUserPassword.php @@ -1,6 +1,8 @@ ['required', 'string'], 'password' => $this->passwordRules(), ])->after(function ($validator) use ($user, $input) { - 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.')); + if (!isset($input['current_password']) || !Hash::check($input['current_password'], $user->password)) { + $validator->errors()->add('current_password', __t('password_doesnt_match')); } })->validateWithBag('updatePassword'); diff --git a/src/App/Users/Exceptions/InvalidUserActionException.php b/src/App/Users/Exceptions/InvalidUserActionException.php index ce69f62e..54cdc629 100644 --- a/src/App/Users/Exceptions/InvalidUserActionException.php +++ b/src/App/Users/Exceptions/InvalidUserActionException.php @@ -5,6 +5,12 @@ use Exception; class InvalidUserActionException extends Exception { - // TODO: translate - protected $message = 'This user action is not allowed.'; + public $message = 'This user action is not allowed.'; + + public function __construct() + { + parent::__construct(); + + $this->message = __t('user_action_not_allowed'); + } } diff --git a/src/App/Users/Notifications/RegistrationBonusAddedNotification.php b/src/App/Users/Notifications/RegistrationBonusAddedNotification.php index 0caae95d..c9520883 100644 --- a/src/App/Users/Notifications/RegistrationBonusAddedNotification.php +++ b/src/App/Users/Notifications/RegistrationBonusAddedNotification.php @@ -34,8 +34,8 @@ class RegistrationBonusAddedNotification extends Notification implements ShouldQ { return [ 'category' => 'gift', - 'title' => "You Received {$this->bonus}", - 'description' => "You received credit bonus $this->bonus for your registration. Happy spending!", + 'title' => __t('you_received_bonus', ['bonus' => $this->bonus]), + 'description' => __t('you_received_registration_bonus_note', ['bonus' => $this->bonus]), ]; } } diff --git a/src/Domain/Folders/Controllers/NavigationTreeController.php b/src/Domain/Folders/Controllers/NavigationTreeController.php index 201ace90..804c5319 100644 --- a/src/Domain/Folders/Controllers/NavigationTreeController.php +++ b/src/Domain/Folders/Controllers/NavigationTreeController.php @@ -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, diff --git a/src/Domain/Localization/Actions/SeedDefaultLanguageTranslationsAction.php b/src/Domain/Localization/Actions/SeedDefaultLanguageTranslationsAction.php index 97efc073..0c1413ff 100644 --- a/src/Domain/Localization/Actions/SeedDefaultLanguageTranslationsAction.php +++ b/src/Domain/Localization/Actions/SeedDefaultLanguageTranslationsAction.php @@ -24,7 +24,7 @@ class SeedDefaultLanguageTranslationsAction $translations = $translations[strtolower($license)] ->map(fn ($value, $key) => [ 'lang' => $locale, - 'value' => $value, + 'value' => '____', 'key' => $key, ])->toArray(); diff --git a/src/Domain/Subscriptions/Notifications/BillingAlertTriggeredNotification.php b/src/Domain/Subscriptions/Notifications/BillingAlertTriggeredNotification.php index 6196036f..79a9af87 100644 --- a/src/Domain/Subscriptions/Notifications/BillingAlertTriggeredNotification.php +++ b/src/Domain/Subscriptions/Notifications/BillingAlertTriggeredNotification.php @@ -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'), ], ], ]; diff --git a/src/Domain/Subscriptions/Notifications/BonusCreditAddedNotification.php b/src/Domain/Subscriptions/Notifications/BonusCreditAddedNotification.php index e9038d8e..cccb39aa 100644 --- a/src/Domain/Subscriptions/Notifications/BonusCreditAddedNotification.php +++ b/src/Domain/Subscriptions/Notifications/BonusCreditAddedNotification.php @@ -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]), ]; } } diff --git a/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedAgainNotification.php b/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedAgainNotification.php new file mode 100644 index 00000000..7a09b0b9 --- /dev/null +++ b/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedAgainNotification.php @@ -0,0 +1,26 @@ +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')); + } +} diff --git a/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedNotification.php b/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedNotification.php new file mode 100644 index 00000000..c5d51aed --- /dev/null +++ b/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedNotification.php @@ -0,0 +1,26 @@ +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')); + } +} diff --git a/src/Domain/Subscriptions/Notifications/ConfirmStripePaymentNotification.php b/src/Domain/Subscriptions/Notifications/ConfirmStripePaymentNotification.php new file mode 100644 index 00000000..cf9dbab1 --- /dev/null +++ b/src/Domain/Subscriptions/Notifications/ConfirmStripePaymentNotification.php @@ -0,0 +1,31 @@ +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']); + } +} diff --git a/src/Domain/Subscriptions/Notifications/InsufficientBalanceNotification.php b/src/Domain/Subscriptions/Notifications/InsufficientBalanceNotification.php index 200ebf15..53027eb8 100644 --- a/src/Domain/Subscriptions/Notifications/InsufficientBalanceNotification.php +++ b/src/Domain/Subscriptions/Notifications/InsufficientBalanceNotification.php @@ -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'), ], ], ]; diff --git a/src/Domain/Subscriptions/Notifications/SubscriptionWasCreatedNotification.php b/src/Domain/Subscriptions/Notifications/SubscriptionWasCreatedNotification.php index 32e8f451..812893a0 100644 --- a/src/Domain/Subscriptions/Notifications/SubscriptionWasCreatedNotification.php +++ b/src/Domain/Subscriptions/Notifications/SubscriptionWasCreatedNotification.php @@ -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'), ], ], ]; diff --git a/src/Domain/Teams/Notifications/InvitationIntoTeamFolder.php b/src/Domain/Teams/Notifications/InvitationIntoTeamFolder.php index 773cd125..ebdd0900 100644 --- a/src/Domain/Teams/Notifications/InvitationIntoTeamFolder.php +++ b/src/Domain/Teams/Notifications/InvitationIntoTeamFolder.php @@ -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' => [ diff --git a/src/Domain/UploadRequest/Controllers/GetFolderTreeForUploadRequestController.php b/src/Domain/UploadRequest/Controllers/GetFolderTreeForUploadRequestController.php index 74f3c374..c002baca 100644 --- a/src/Domain/UploadRequest/Controllers/GetFolderTreeForUploadRequestController.php +++ b/src/Domain/UploadRequest/Controllers/GetFolderTreeForUploadRequestController.php @@ -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, diff --git a/src/Domain/UploadRequest/Controllers/UploadFilesForUploadRequestController.php b/src/Domain/UploadRequest/Controllers/UploadFilesForUploadRequestController.php index d50e63b8..164aa6d9 100644 --- a/src/Domain/UploadRequest/Controllers/UploadFilesForUploadRequestController.php +++ b/src/Domain/UploadRequest/Controllers/UploadFilesForUploadRequestController.php @@ -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(), ]); diff --git a/src/Domain/UploadRequest/Notifications/UploadRequestFulfilledNotification.php b/src/Domain/UploadRequest/Notifications/UploadRequestFulfilledNotification.php index ec7d70d5..5b044ca5 100644 --- a/src/Domain/UploadRequest/Notifications/UploadRequestFulfilledNotification.php +++ b/src/Domain/UploadRequest/Notifications/UploadRequestFulfilledNotification.php @@ -1,4 +1,5 @@ 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, ], ], diff --git a/src/Domain/UploadRequest/Notifications/UploadRequestNotification.php b/src/Domain/UploadRequest/Notifications/UploadRequestNotification.php index 246e4450..614e2665 100644 --- a/src/Domain/UploadRequest/Notifications/UploadRequestNotification.php +++ b/src/Domain/UploadRequest/Notifications/UploadRequestNotification.php @@ -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')); } /** diff --git a/tests/App/Users/UserSubscriptionTest.php b/tests/App/Users/UserSubscriptionTest.php index 328031e5..f98b8b31 100644 --- a/tests/App/Users/UserSubscriptionTest.php +++ b/tests/App/Users/UserSubscriptionTest.php @@ -110,12 +110,12 @@ class UserSubscriptionTest extends TestCase $usages = collect([ [ 'feature' => 'bandwidth', - 'amount' => 7546.96, - 'usage' => 26024, + 'amount' => 7.54696, + 'usage' => 2.6024, ], [ 'feature' => 'storage', - 'amount' => 476.28, - 'usage' => 3969, + 'amount' => 0.47628, + 'usage' => 3.969, ], [ 'feature' => 'flatFee', 'amount' => 2.49, @@ -136,7 +136,7 @@ class UserSubscriptionTest extends TestCase 'feature' => 'bandwidth', 'amount' => 7.54696, 'cost' => '$7.55', - 'usage' => '26.02GB', + 'usage' => '2.60GB', ], 'storage' => [ 'feature' => 'storage', diff --git a/tests/Domain/Browsing/BrowseTest.php b/tests/Domain/Browsing/BrowseTest.php index 81b03890..4486b88d 100644 --- a/tests/Domain/Browsing/BrowseTest.php +++ b/tests/Domain/Browsing/BrowseTest.php @@ -121,7 +121,7 @@ class BrowseTest extends TestCase ], [ 'location' => 'shared-with-me', - 'name' => 'Shared With Me', + 'name' => 'Shared with Me', 'folders' => [], 'isMovable' => false, 'isOpen' => false, diff --git a/tests/Domain/Maintenance/AppUpgradeTest.php b/tests/Domain/Maintenance/AppUpgradeTest.php index f8652678..66a92830 100644 --- a/tests/Domain/Maintenance/AppUpgradeTest.php +++ b/tests/Domain/Maintenance/AppUpgradeTest.php @@ -28,12 +28,12 @@ class AppUpgradeTest extends TestCase DB::table('language_translations') ->insert([ [ - 'key' => 'activation.stripe.button', - 'value' => 'Set up your Stripe account', + 'key' => 'type', + 'value' => 'Type', 'lang' => $locale, ], [ - 'key' => 'activation.stripe.description', - 'value' => 'This is original test description', + 'key' => 'cancel', + 'value' => 'Cancel', 'lang' => $locale, ], ]); @@ -47,20 +47,14 @@ class AppUpgradeTest extends TestCase collect(['en', 'sk']) ->map(function ($locale) { $this->assertDatabaseHas('language_translations', [ - 'key' => 'activation.stripe.title', - 'value' => 'Your Stripe account is not set', + 'key' => 'close', + 'value' => 'Close', 'lang' => $locale, ]); $this->assertDatabaseHas('language_translations', [ - 'key' => 'activation.stripe.description', - 'value' => 'This is original test description', - 'lang' => $locale, - ]); - - $this->assertDatabaseMissing('language_translations', [ - 'key' => 'activation.stripe.description', - 'value' => 'To charge your users, please set up your Stripe account credentials.', + 'key' => 'create_folder', + 'value' => 'Create folder', 'lang' => $locale, ]); }); diff --git a/tests/Support/Scheduler/SchedulerTest.php b/tests/Support/Scheduler/SchedulerTest.php index 0f03e177..2b3a216e 100644 --- a/tests/Support/Scheduler/SchedulerTest.php +++ b/tests/Support/Scheduler/SchedulerTest.php @@ -72,12 +72,12 @@ class SchedulerTest extends TestCase ->assertDatabaseHas('usages', [ 'metered_feature_id' => $plan->meteredFeatures()->get()[0]->id, 'subscription_id' => $subscription->id, - 'quantity' => 125, + 'quantity' => 0.125, ]) ->assertDatabaseHas('usages', [ 'metered_feature_id' => $plan->meteredFeatures()->get()[1]->id, 'subscription_id' => $subscription->id, - 'quantity' => 410, + 'quantity' => 0.410, ]); }