diff --git a/controllers/front/AbstractOpcJsonFrontController.php b/controllers/front/AbstractOpcJsonFrontController.php index 4ea5acf..ec65889 100644 --- a/controllers/front/AbstractOpcJsonFrontController.php +++ b/controllers/front/AbstractOpcJsonFrontController.php @@ -1,7 +1,6 @@ false, 'errors' => [ '' => [ - $this->trans('One-page checkout is currently unavailable.', [], ModuleTranslation::SHOP_DOMAIN), + $this->trans('One-page checkout is currently unavailable.', [], 'Modules.Onepagecheckout.Shop'), ], ], ]; diff --git a/ps_onepagecheckout.php b/ps_onepagecheckout.php index 3530b67..55eff4e 100644 --- a/ps_onepagecheckout.php +++ b/ps_onepagecheckout.php @@ -16,7 +16,6 @@ use PrestaShop\Module\PsOnePageCheckout\Checkout\OnePageCheckoutAvailability; use PrestaShop\Module\PsOnePageCheckout\Checkout\OnePageCheckoutProcessProvider; use PrestaShop\Module\PsOnePageCheckout\Form\BackOfficeConfigurationForm; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use PrestaShop\PrestaShop\Adapter\Order\Checkout\CheckoutProcessProviderInterface; class Ps_Onepagecheckout extends Module @@ -35,7 +34,7 @@ public function __construct() $tabNames = []; foreach (Language::getLanguages(true) as $lang) { - $tabNames[$lang['locale']] = $this->trans('Checkout', [], ModuleTranslation::ADMIN_DOMAIN, $lang['locale']); + $tabNames[$lang['locale']] = $this->trans('Checkout', [], 'Modules.Onepagecheckout.Admin', $lang['locale']); } $this->tabs = [ [ @@ -44,17 +43,17 @@ public function __construct() 'name' => $tabNames, 'parent_class_name' => 'AdminParentThemes', 'wording' => 'Checkout', - 'wording_domain' => ModuleTranslation::ADMIN_DOMAIN, + 'wording_domain' => 'Modules.Onepagecheckout.Admin', ], ]; parent::__construct(); - $this->displayName = $this->trans('One-page checkout', [], ModuleTranslation::ADMIN_DOMAIN); + $this->displayName = $this->trans('One-page checkout', [], 'Modules.Onepagecheckout.Admin'); $this->description = $this->trans( 'Native one-page checkout.', [], - ModuleTranslation::ADMIN_DOMAIN + 'Modules.Onepagecheckout.Admin' ); $this->ps_versions_compliancy = ['min' => '9.0.0', 'max' => _PS_VERSION_]; $this->controllers = [ @@ -72,6 +71,11 @@ public function __construct() ]; } + public function isUsingNewTranslationSystem(): bool + { + return true; + } + public function install() { return $this->installInParent() @@ -292,23 +296,23 @@ public function hookActionFrontControllerSetMedia(): void ), ], 'messages' => [ - 'missingGuestInitUrl' => $this->trans('Unable to initialize checkout customer.', [], ModuleTranslation::SHOP_DOMAIN), - 'missingAddressFormUrl' => $this->trans('Unable to refresh addresses.', [], ModuleTranslation::SHOP_DOMAIN), - 'loadCarriersFailed' => $this->trans('Unable to load delivery methods.', [], ModuleTranslation::SHOP_DOMAIN), - 'missingCarrierSelectionPayload' => $this->trans('Missing delivery option.', [], ModuleTranslation::SHOP_DOMAIN), - 'selectCarrierFailed' => $this->trans('Unable to select the delivery method.', [], ModuleTranslation::SHOP_DOMAIN), - 'loadPaymentMethodsFailed' => $this->trans('Unable to load payment methods.', [], ModuleTranslation::SHOP_DOMAIN), - 'missingPaymentSelectionPayload' => $this->trans('Missing payment selection payload.', [], ModuleTranslation::SHOP_DOMAIN), - 'selectPaymentFailed' => $this->trans('Unable to select the payment method.', [], ModuleTranslation::SHOP_DOMAIN), - 'statesLoadFailed' => $this->trans('Unable to load states.', [], ModuleTranslation::SHOP_DOMAIN), - 'missingSaveAddressUrl' => $this->trans('Unable to save address.', [], ModuleTranslation::SHOP_DOMAIN), - 'saveAddressFailed' => $this->trans('Unable to save address.', [], ModuleTranslation::SHOP_DOMAIN), - 'missingDeleteAddressUrl' => $this->trans('Unable to delete address.', [], ModuleTranslation::SHOP_DOMAIN), - 'deleteAddressFailed' => $this->trans('Unable to delete address.', [], ModuleTranslation::SHOP_DOMAIN), - 'refreshAddressesFailed' => $this->trans('Unable to refresh addresses.', [], ModuleTranslation::SHOP_DOMAIN), - 'missingPaymentForm' => $this->trans('Unable to initialize the selected payment method.', [], ModuleTranslation::SHOP_DOMAIN), - 'missingSubmitUrl' => $this->trans('Unable to submit checkout.', [], ModuleTranslation::SHOP_DOMAIN), - 'submitFailed' => $this->trans('Unable to submit checkout.', [], ModuleTranslation::SHOP_DOMAIN), + 'missingGuestInitUrl' => $this->trans('Unable to initialize checkout customer.', [], 'Modules.Onepagecheckout.Shop'), + 'missingAddressFormUrl' => $this->trans('Unable to refresh addresses.', [], 'Modules.Onepagecheckout.Shop'), + 'loadCarriersFailed' => $this->trans('Unable to load delivery methods.', [], 'Modules.Onepagecheckout.Shop'), + 'missingCarrierSelectionPayload' => $this->trans('Missing delivery option.', [], 'Modules.Onepagecheckout.Shop'), + 'selectCarrierFailed' => $this->trans('Unable to select the delivery method.', [], 'Modules.Onepagecheckout.Shop'), + 'loadPaymentMethodsFailed' => $this->trans('Unable to load payment methods.', [], 'Modules.Onepagecheckout.Shop'), + 'missingPaymentSelectionPayload' => $this->trans('Missing payment selection payload.', [], 'Modules.Onepagecheckout.Shop'), + 'selectPaymentFailed' => $this->trans('Unable to select the payment method.', [], 'Modules.Onepagecheckout.Shop'), + 'statesLoadFailed' => $this->trans('Unable to load states.', [], 'Modules.Onepagecheckout.Shop'), + 'missingSaveAddressUrl' => $this->trans('Unable to save address.', [], 'Modules.Onepagecheckout.Shop'), + 'saveAddressFailed' => $this->trans('Unable to save address.', [], 'Modules.Onepagecheckout.Shop'), + 'missingDeleteAddressUrl' => $this->trans('Unable to delete address.', [], 'Modules.Onepagecheckout.Shop'), + 'deleteAddressFailed' => $this->trans('Unable to delete address.', [], 'Modules.Onepagecheckout.Shop'), + 'refreshAddressesFailed' => $this->trans('Unable to refresh addresses.', [], 'Modules.Onepagecheckout.Shop'), + 'missingPaymentForm' => $this->trans('Unable to initialize the selected payment method.', [], 'Modules.Onepagecheckout.Shop'), + 'missingSubmitUrl' => $this->trans('Unable to submit checkout.', [], 'Modules.Onepagecheckout.Shop'), + 'submitFailed' => $this->trans('Unable to submit checkout.', [], 'Modules.Onepagecheckout.Shop'), ], ]; diff --git a/src/Checkout/Ajax/Address/OnePageCheckoutAddressesListHandler.php b/src/Checkout/Ajax/Address/OnePageCheckoutAddressesListHandler.php index bbbc04f..a740df0 100644 --- a/src/Checkout/Ajax/Address/OnePageCheckoutAddressesListHandler.php +++ b/src/Checkout/Ajax/Address/OnePageCheckoutAddressesListHandler.php @@ -2,7 +2,6 @@ namespace PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutAddressesListHandler @@ -35,7 +34,7 @@ public function handle(): array $customer = $this->customerResolver->resolve(); if (!$customer instanceof \Customer) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to resolve checkout customer.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to resolve checkout customer.', [], 'Modules.Onepagecheckout.Shop') ); } diff --git a/src/Checkout/Ajax/Address/OnePageCheckoutDeleteAddressHandler.php b/src/Checkout/Ajax/Address/OnePageCheckoutDeleteAddressHandler.php index ee64409..ef40148 100644 --- a/src/Checkout/Ajax/Address/OnePageCheckoutDeleteAddressHandler.php +++ b/src/Checkout/Ajax/Address/OnePageCheckoutDeleteAddressHandler.php @@ -2,7 +2,6 @@ namespace PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutDeleteAddressHandler @@ -34,14 +33,14 @@ public function handle(array $requestParameters = []): array $customer = $this->customerResolver->resolve(); if (!$customer instanceof \Customer) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to resolve checkout customer.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to resolve checkout customer.', [], 'Modules.Onepagecheckout.Shop') ); } $address = $this->loadOwnedAddress($customer, (int) ($requestParameters['id_address'] ?? 0)); if (!$address instanceof \Address) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to load the requested address.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to load the requested address.', [], 'Modules.Onepagecheckout.Shop') ); } @@ -54,7 +53,7 @@ public function handle(array $requestParameters = []): array if (!$this->buildAddressPersister($customer)->delete($address, \Tools::getToken(true, $this->context))) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to delete address.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to delete address.', [], 'Modules.Onepagecheckout.Shop') ); } @@ -75,7 +74,7 @@ public function handle(array $requestParameters = []): array return [ 'success' => true, 'id_address' => $addressId, - 'message' => $this->translator->trans('Address successfully deleted.', [], ModuleTranslation::SHOP_DOMAIN), + 'message' => $this->translator->trans('Address successfully deleted.', [], 'Modules.Onepagecheckout.Shop'), ]; } diff --git a/src/Checkout/Ajax/Address/OnePageCheckoutSaveAddressHandler.php b/src/Checkout/Ajax/Address/OnePageCheckoutSaveAddressHandler.php index e7c3cf5..400117d 100644 --- a/src/Checkout/Ajax/Address/OnePageCheckoutSaveAddressHandler.php +++ b/src/Checkout/Ajax/Address/OnePageCheckoutSaveAddressHandler.php @@ -4,7 +4,6 @@ use PrestaShop\Module\PsOnePageCheckout\Form\OnePageCheckoutAddressForm; use PrestaShop\Module\PsOnePageCheckout\Form\OnePageCheckoutAddressFormatter; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutSaveAddressHandler @@ -33,7 +32,7 @@ public function handle(array $requestParameters = []): array $customerId = $this->customerResolver->resolveId(); if ($customerId <= 0) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to resolve checkout customer.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to resolve checkout customer.', [], 'Modules.Onepagecheckout.Shop') ); } @@ -44,7 +43,7 @@ public function handle(array $requestParameters = []): array if ($addressId > 0 && (!\Validate::isLoadedObject($address) || (int) $address->id_customer !== $customerId)) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to load the requested address.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to load the requested address.', [], 'Modules.Onepagecheckout.Shop') ); } @@ -58,7 +57,7 @@ public function handle(array $requestParameters = []): array if (!$this->buildAddressPersister($customerId)->save($address, \Tools::getToken(true, $this->context))) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to save address.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to save address.', [], 'Modules.Onepagecheckout.Shop') ); } @@ -124,8 +123,8 @@ private function hydrateAddressFromForm( $address->id_customer = $customerId; $address->alias = trim((string) ($address->alias ?: ($addressType === 'invoice' - ? $this->translator->trans('Invoice address', [], ModuleTranslation::SHOP_DOMAIN) - : $this->translator->trans('My Address', [], ModuleTranslation::SHOP_DOMAIN)))); + ? $this->translator->trans('Invoice address', [], 'Modules.Onepagecheckout.Shop') + : $this->translator->trans('My Address', [], 'Modules.Onepagecheckout.Shop')))); $address->id_country = (int) $address->id_country; $address->id_state = (int) ($address->id_state ?: 0); \Hook::exec('actionSubmitCustomerAddressForm', ['address' => &$address]); diff --git a/src/Checkout/Ajax/Carrier/OnePageCheckoutCarriersHandler.php b/src/Checkout/Ajax/Carrier/OnePageCheckoutCarriersHandler.php index 12f620a..f6dd324 100644 --- a/src/Checkout/Ajax/Carrier/OnePageCheckoutCarriersHandler.php +++ b/src/Checkout/Ajax/Carrier/OnePageCheckoutCarriersHandler.php @@ -2,7 +2,6 @@ namespace PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutCarriersHandler @@ -54,7 +53,7 @@ public function handle(array $requestParameters = []): array $requestedAddressId = (int) $requestParameters['id_address_delivery']; if (!$this->isOwnedCheckoutAddress($requestedAddressId)) { return CheckoutAjaxResponse::error( - $this->translator->trans('Invalid delivery address.', [], ModuleTranslation::SHOP_DOMAIN), + $this->translator->trans('Invalid delivery address.', [], 'Modules.Onepagecheckout.Shop'), 'id_address_delivery' ); } diff --git a/src/Checkout/Ajax/Carrier/OnePageCheckoutSelectCarrierHandler.php b/src/Checkout/Ajax/Carrier/OnePageCheckoutSelectCarrierHandler.php index c6ae7a3..a4babb2 100644 --- a/src/Checkout/Ajax/Carrier/OnePageCheckoutSelectCarrierHandler.php +++ b/src/Checkout/Ajax/Carrier/OnePageCheckoutSelectCarrierHandler.php @@ -2,7 +2,6 @@ namespace PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutSelectCarrierHandler @@ -41,14 +40,14 @@ public function handle(array $requestParameters = []): array $deliveryOption = (string) ($requestParameters['delivery_option'] ?? ''); if ($deliveryOption === '') { return CheckoutAjaxResponse::error( - $this->translator->trans('Missing delivery option.', [], ModuleTranslation::SHOP_DOMAIN), + $this->translator->trans('Missing delivery option.', [], 'Modules.Onepagecheckout.Shop'), 'delivery_option' ); } if (!\Validate::isLoadedObject($this->context->cart)) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to resolve the current cart.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to resolve the current cart.', [], 'Modules.Onepagecheckout.Shop') ); } @@ -62,7 +61,7 @@ public function handle(array $requestParameters = []): array if ($deliveryAddressId <= 0) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to resolve the current delivery address.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to resolve the current delivery address.', [], 'Modules.Onepagecheckout.Shop') ); } diff --git a/src/Checkout/Ajax/Customer/OnePageCheckoutGuestInitHandler.php b/src/Checkout/Ajax/Customer/OnePageCheckoutGuestInitHandler.php index 755480b..7447a3d 100644 --- a/src/Checkout/Ajax/Customer/OnePageCheckoutGuestInitHandler.php +++ b/src/Checkout/Ajax/Customer/OnePageCheckoutGuestInitHandler.php @@ -14,7 +14,6 @@ use Db; use PrestaShop\Module\PsOnePageCheckout\Checkout\ExistingCustomerState; use PrestaShop\Module\PsOnePageCheckout\Form\OnePageCheckoutForm; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use PrestaShop\PrestaShop\Core\Util\InternationalizedDomainNameConverter; use Symfony\Contracts\Translation\TranslatorInterface; @@ -120,7 +119,7 @@ public function handle(array $requestParameters): array if (!$this->isOnePageCheckoutEnabled) { return $this->errorResponse( self::ERROR_FIELD_GLOBAL, - $this->translator->trans('One-page checkout is not enabled.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('One-page checkout is not enabled.', [], 'Modules.Onepagecheckout.Shop') ); } @@ -133,7 +132,7 @@ public function handle(array $requestParameters): array if (!$this->isTokenValid($requestParameters)) { return $this->errorResponse( self::ERROR_FIELD_TOKEN, - $this->translator->trans('Invalid security token.', [], ModuleTranslation::SHOP_DOMAIN), + $this->translator->trans('Invalid security token.', [], 'Modules.Onepagecheckout.Shop'), false ); } @@ -473,7 +472,7 @@ private function resolveGuestEmail(string $submittedEmail, ExistingCustomerState if (!$this->customerPersister->save($existingCustomer, '', '', false)) { return $this->errorResponse( self::ERROR_FIELD_EMAIL, - $this->translator->trans(self::ERROR_GUEST_EMAIL_UPDATE_FAILED, [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans(self::ERROR_GUEST_EMAIL_UPDATE_FAILED, [], 'Modules.Onepagecheckout.Shop') ); } @@ -686,7 +685,7 @@ private function cartSyncErrorResponse(): array { return $this->errorResponse( self::ERROR_FIELD_GLOBAL, - $this->translator->trans(self::ERROR_CART_CUSTOMER_SYNC_FAILED, [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans(self::ERROR_CART_CUSTOMER_SYNC_FAILED, [], 'Modules.Onepagecheckout.Shop') ); } diff --git a/src/Checkout/Ajax/OrderOptions/OnePageCheckoutGiftWrappingHandler.php b/src/Checkout/Ajax/OrderOptions/OnePageCheckoutGiftWrappingHandler.php index d21b520..d637582 100644 --- a/src/Checkout/Ajax/OrderOptions/OnePageCheckoutGiftWrappingHandler.php +++ b/src/Checkout/Ajax/OrderOptions/OnePageCheckoutGiftWrappingHandler.php @@ -8,7 +8,6 @@ use PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax\OpcTempAddress; use PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax\TempAddressCarrierSelectionStorage; use PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax\TempAddressStorage; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutGiftWrappingHandler @@ -39,13 +38,13 @@ public function handle(array $requestParameters = []): array { if (!\Validate::isLoadedObject($this->context->cart)) { return CheckoutAjaxResponse::error( - $this->translator->trans('Unable to resolve the current cart.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Unable to resolve the current cart.', [], 'Modules.Onepagecheckout.Shop') ); } if (!(bool) \Configuration::get('PS_GIFT_WRAPPING')) { return CheckoutAjaxResponse::error( - $this->translator->trans('Gift wrapping is currently unavailable.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Gift wrapping is currently unavailable.', [], 'Modules.Onepagecheckout.Shop') ); } diff --git a/src/Checkout/Ajax/Payment/OnePageCheckoutSelectPaymentHandler.php b/src/Checkout/Ajax/Payment/OnePageCheckoutSelectPaymentHandler.php index 4d40a1a..161d570 100644 --- a/src/Checkout/Ajax/Payment/OnePageCheckoutSelectPaymentHandler.php +++ b/src/Checkout/Ajax/Payment/OnePageCheckoutSelectPaymentHandler.php @@ -2,7 +2,6 @@ namespace PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutSelectPaymentHandler @@ -29,7 +28,7 @@ public function handle(array $requestParameters = []): array if ($this->hasMissingPaymentSelectionPayload($paymentOption, $paymentModule, $paymentSelectionKey)) { return CheckoutAjaxResponse::error( - $this->translator->trans('Missing payment selection payload.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Missing payment selection payload.', [], 'Modules.Onepagecheckout.Shop') ); } diff --git a/src/Checkout/Ajax/Submit/OnePageCheckoutSubmitProcessor.php b/src/Checkout/Ajax/Submit/OnePageCheckoutSubmitProcessor.php index 7b5c161..6ba6942 100644 --- a/src/Checkout/Ajax/Submit/OnePageCheckoutSubmitProcessor.php +++ b/src/Checkout/Ajax/Submit/OnePageCheckoutSubmitProcessor.php @@ -4,7 +4,6 @@ use PrestaShop\Module\PsOnePageCheckout\Checkout\PaymentSelectionKeyBuilder; use PrestaShop\Module\PsOnePageCheckout\Form\OnePageCheckoutForm; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutSubmitProcessor @@ -133,7 +132,7 @@ private function validateIdentitySection(array $requestParameters): bool } $this->validationErrors['identity'] = [ - 'email' => $this->translator->trans('Invalid email format.', [], ModuleTranslation::SHOP_DOMAIN), + 'email' => $this->translator->trans('Invalid email format.', [], 'Modules.Onepagecheckout.Shop'), ]; return false; @@ -171,7 +170,7 @@ private function validateShippingSection(\CheckoutSession $checkoutSession, arra if ($deliveryOptionKey === '' || empty($deliveryOptions[$deliveryOptionKey])) { $this->validationErrors['shipping'] = [ - 'delivery_option' => $this->translator->trans('Please select a shipping method.', [], ModuleTranslation::SHOP_DOMAIN), + 'delivery_option' => $this->translator->trans('Please select a shipping method.', [], 'Modules.Onepagecheckout.Shop'), ]; return false; @@ -211,7 +210,7 @@ private function validatePaymentSection(\CheckoutSession $checkoutSession, array } $this->validationErrors['payment'] = [ - 'paymentMethod' => $this->translator->trans('Please select a payment method.', [], ModuleTranslation::SHOP_DOMAIN), + 'paymentMethod' => $this->translator->trans('Please select a payment method.', [], 'Modules.Onepagecheckout.Shop'), ]; return false; @@ -235,7 +234,7 @@ private function validateConditionsSection(array $requestParameters): bool } $this->validationErrors['conditions'] = [ - 'conditions_to_approve' => $this->translator->trans('Please accept the terms of service.', [], ModuleTranslation::SHOP_DOMAIN), + 'conditions_to_approve' => $this->translator->trans('Please accept the terms of service.', [], 'Modules.Onepagecheckout.Shop'), ]; return false; diff --git a/src/Checkout/CheckoutOnePageStep.php b/src/Checkout/CheckoutOnePageStep.php index 8963d32..7add484 100644 --- a/src/Checkout/CheckoutOnePageStep.php +++ b/src/Checkout/CheckoutOnePageStep.php @@ -29,7 +29,6 @@ use PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax\Submit\OnePageCheckoutSubmitValidationStateStorage; use PrestaShop\Module\PsOnePageCheckout\Form\OnePageCheckoutForm; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use PrestaShop\PrestaShop\Adapter\Product\PriceFormatter; use Symfony\Contracts\Translation\TranslatorInterface; @@ -193,7 +192,7 @@ public function handleRequest(array $requestParameters = []) } $this->setTitle( - $this->getTranslator()->trans('Checkout', [], ModuleTranslation::SHOP_DOMAIN) + $this->getTranslator()->trans('Checkout', [], 'Modules.Onepagecheckout.Shop') ); } diff --git a/src/Form/BackOfficeConfigurationForm.php b/src/Form/BackOfficeConfigurationForm.php index ac85fa1..6d6b77d 100644 --- a/src/Form/BackOfficeConfigurationForm.php +++ b/src/Form/BackOfficeConfigurationForm.php @@ -30,7 +30,6 @@ namespace PrestaShop\Module\PsOnePageCheckout\Form; use PrestaShop\Module\PsOnePageCheckout\Analytics\Analytics; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Twig\Environment; class BackOfficeConfigurationForm @@ -72,7 +71,7 @@ public function renderBackOfficeConfiguration(): string if ($isMaintenanceEnabled && !$this->enableMaintenanceMode()) { return $this->module->displayError( - $this->trans('Unable to enable maintenance mode. Checkout layout was not changed.', 'Modules.PsOnePageCheckout.Admin') + $this->trans('Unable to enable maintenance mode. Checkout layout was not changed.', 'Modules.Onepagecheckout.Admin') ) . $this->renderConfigurationForm(); } @@ -92,7 +91,7 @@ public function renderBackOfficeConfiguration(): string if ($this->consumeMaintenanceFlash()) { $output .= $this->module->displayWarning( - $this->trans('Checkout layout has been changed. Shop is now in maintenance mode.', 'Modules.PsOnePageCheckout.Admin') + $this->trans('Checkout layout has been changed. Shop is now in maintenance mode.', 'Modules.Onepagecheckout.Admin') ); } elseif ($this->consumeSuccessFlash()) { $output .= $this->module->displayConfirmation( @@ -127,8 +126,8 @@ private function renderConfigurationForm(): string private function buildTemplateVariables(): array { $isEnabled = $this->getCurrentConfigurationValue() === 1; - $onePageLabel = $this->trans('One-page checkout', 'Admin.Design.Feature'); - $fourPageLabel = $this->trans('Four-page checkout', 'Admin.Design.Feature'); + $onePageLabel = $this->trans('One-page checkout', 'Modules.Onepagecheckout.Admin'); + $fourPageLabel = $this->trans('Four-page checkout', 'Modules.Onepagecheckout.Admin'); $isMaintenanceEnabled = (int) \Configuration::get('PS_SHOP_ENABLE') === 0; @@ -143,29 +142,29 @@ private function buildTemplateVariables(): array 'Note that this page is available in a single shop context only. Switch context to work on it.', 'Admin.Notifications.Info' ), - 'checkout_layout_title' => $this->trans('Checkout layout', 'Admin.Design.Feature'), + 'checkout_layout_title' => $this->trans('Checkout layout', 'Modules.Onepagecheckout.Admin'), 'checkout_layout_description' => $this->trans( 'Allow faster checkout for higher conversion and spontaneous purchases.', - 'Admin.Design.Feature' + 'Modules.Onepagecheckout.Admin' ), 'save_button_label' => $this->trans('Save', 'Admin.Actions'), - 'confirm_modal_title' => $this->trans('Change checkout appearance', 'Modules.PsOnePageCheckout.Admin'), - 'confirm_modal_compatibility_title' => $this->trans('Check theme compatibility', 'Modules.PsOnePageCheckout.Admin'), - 'confirm_modal_description' => $this->trans('You\'re about to update the Checkout appearance of your store.', 'Modules.PsOnePageCheckout.Admin'), - 'confirm_modal_compatibility_description' => $this->trans('One-page checkout layout requires a Bootstrap 5-compatible theme.', 'Modules.PsOnePageCheckout.Admin'), - 'confirm_modal_checklist_title' => $this->trans('Before you proceed, please make sure that:', 'Modules.PsOnePageCheckout.Admin'), + 'confirm_modal_title' => $this->trans('Change checkout appearance', 'Modules.Onepagecheckout.Admin'), + 'confirm_modal_compatibility_title' => $this->trans('Check theme compatibility', 'Modules.Onepagecheckout.Admin'), + 'confirm_modal_description' => $this->trans('You\'re about to update the Checkout appearance of your store.', 'Modules.Onepagecheckout.Admin'), + 'confirm_modal_compatibility_description' => $this->trans('One-page checkout layout requires a Bootstrap 5-compatible theme.', 'Modules.Onepagecheckout.Admin'), + 'confirm_modal_checklist_title' => $this->trans('Before you proceed, please make sure that:', 'Modules.Onepagecheckout.Admin'), 'confirm_modal_checklist' => [ - $this->trans('You are NOT using the "Classic" theme: This layout is incompatible with the legacy Classic theme and will break your storefront.', 'Modules.PsOnePageCheckout.Admin'), - $this->trans('Your theme is compatible with the one-page checkout DOM and Bootstrap 5: Custom or third-party themes must support this new checkout architecture.', 'Modules.PsOnePageCheckout.Admin'), - $this->trans('Your checkout modules are compatible. Some older modules may not be compatible with a one-page layout.', 'Modules.PsOnePageCheckout.Admin'), + $this->trans('You are NOT using the "Classic" theme: This layout is incompatible with the legacy Classic theme and will break your storefront.', 'Modules.Onepagecheckout.Admin'), + $this->trans('Your theme is compatible with the one-page checkout DOM and Bootstrap 5: Custom or third-party themes must support this new checkout architecture.', 'Modules.Onepagecheckout.Admin'), + $this->trans('Your checkout modules are compatible. Some older modules may not be compatible with a one-page layout.', 'Modules.Onepagecheckout.Admin'), ], 'cancel_button_label' => $this->trans('Cancel', 'Admin.Actions'), - 'confirm_button_label' => $this->trans('Change checkout appearance', 'Modules.PsOnePageCheckout.Admin'), + 'confirm_button_label' => $this->trans('Change checkout appearance', 'Modules.Onepagecheckout.Admin'), 'maintenance_mode_input_name' => self::MAINTENANCE_INPUT_NAME, - 'maintenance_mode_label' => $this->trans('Maintenance mode', 'Modules.PsOnePageCheckout.Admin'), + 'maintenance_mode_label' => $this->trans('Maintenance mode', 'Modules.Onepagecheckout.Admin'), 'maintenance_mode_warning' => $this->trans( 'We strongly recommend enabling Maintenance Mode or testing this in a Staging Environment first to ensure a smooth transition for your customers.', - 'Modules.PsOnePageCheckout.Admin' + 'Modules.Onepagecheckout.Admin' ), 'choices' => [ [ @@ -173,18 +172,18 @@ private function buildTemplateVariables(): array 'value' => 1, 'checked' => $isEnabled, 'label' => $onePageLabel, - 'badge' => $this->trans('Recommended', 'Admin.Design.Feature'), + 'badge' => $this->trans('Recommended', 'Modules.Onepagecheckout.Admin'), 'description' => $this->trans( 'Propose the best checkout experience to your clients with the one-page layout. All the payment steps will be displayed in one page and let you benefit from:', - 'Admin.Design.Feature' + 'Modules.Onepagecheckout.Admin' ), 'features' => [ - $this->trans('Reduced time spent, less clicks & no extra-step', 'Admin.Design.Feature'), + $this->trans('Reduced time spent, less clicks & no extra-step', 'Modules.Onepagecheckout.Admin'), $this->trans( 'Increased conversion with a seamless and frictionless experience', - 'Admin.Design.Feature' + 'Modules.Onepagecheckout.Admin' ), - $this->trans('Mobile-friendly checkout', 'Admin.Design.Feature'), + $this->trans('Mobile-friendly checkout', 'Modules.Onepagecheckout.Admin'), ], 'illustration' => $this->module->getPathUri() . 'views/img/checkout/one-page-checkout.svg', ], @@ -196,15 +195,15 @@ private function buildTemplateVariables(): array 'badge' => '', 'description' => $this->trans( 'Propose a step-by-step checkout experience. All the usual payment steps will be displayed on different screens. Choose this method if:', - 'Admin.Design.Feature' + 'Modules.Onepagecheckout.Admin' ), 'features' => [ $this->trans( 'You need flexibility for complex or specific information', - 'Admin.Design.Feature' + 'Modules.Onepagecheckout.Admin' ), - $this->trans('You\'re under regulatory compliance', 'Admin.Design.Feature'), - $this->trans('You want to integrate upsell & cross-sell strategies', 'Admin.Design.Feature'), + $this->trans('You\'re under regulatory compliance', 'Modules.Onepagecheckout.Admin'), + $this->trans('You want to integrate upsell & cross-sell strategies', 'Modules.Onepagecheckout.Admin'), ], 'illustration' => $this->module->getPathUri() . 'views/img/checkout/four-page-checkout.svg', ], @@ -242,7 +241,7 @@ private function registerBackOfficeAssets(): void ); } - private function trans(string $message, string $domain = ModuleTranslation::ADMIN_DOMAIN): string + private function trans(string $message, string $domain = 'Modules.Onepagecheckout.Admin'): string { $translator = \Context::getContext()->getTranslator(); diff --git a/src/Form/OnePageCheckoutForm.php b/src/Form/OnePageCheckoutForm.php index 60d6267..446bbcc 100644 --- a/src/Form/OnePageCheckoutForm.php +++ b/src/Form/OnePageCheckoutForm.php @@ -33,7 +33,6 @@ use Customer; use PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax\CheckoutCustomerContextResolver; use PrestaShop\Module\PsOnePageCheckout\Checkout\Ajax\CheckoutCustomerTemplateBuilder; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use PrestaShop\PrestaShop\Core\Util\InternationalizedDomainNameConverter; use Symfony\Contracts\Translation\TranslatorInterface; use Validate; @@ -312,7 +311,7 @@ public function submit() ); $deliveryAddress->id_customer = $customer->id; if (empty($deliveryAddress->alias)) { - $deliveryAddress->alias = $this->translator->trans('My Address', [], ModuleTranslation::SHOP_DOMAIN); + $deliveryAddress->alias = $this->translator->trans('My Address', [], 'Modules.Onepagecheckout.Shop'); } \Hook::exec('actionSubmitCustomerAddressForm', ['address' => &$deliveryAddress]); if (!$this->addressPersister->save($deliveryAddress, $token)) { @@ -338,7 +337,7 @@ public function submit() 'invoice_' ); $invoiceAddress->id_customer = $customer->id; - $invoiceAddress->alias = $invoiceAddress->alias ?: $this->translator->trans('Invoice address', [], ModuleTranslation::SHOP_DOMAIN); + $invoiceAddress->alias = $invoiceAddress->alias ?: $this->translator->trans('Invoice address', [], 'Modules.Onepagecheckout.Shop'); \Hook::exec('actionSubmitCustomerAddressForm', ['address' => &$invoiceAddress]); if (!$this->addressPersister->save($invoiceAddress, $token)) { return false; @@ -559,7 +558,7 @@ private function isGuestInitEmailValid(): bool } $emailField->addError( - $this->translator->trans('Invalid email format.', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Invalid email format.', [], 'Modules.Onepagecheckout.Shop') ); return false; diff --git a/src/Form/OnePageCheckoutFormatter.php b/src/Form/OnePageCheckoutFormatter.php index 4529605..e6ceec2 100644 --- a/src/Form/OnePageCheckoutFormatter.php +++ b/src/Form/OnePageCheckoutFormatter.php @@ -29,7 +29,6 @@ use Address; use Country; -use PrestaShop\Module\PsOnePageCheckout\Translation\ModuleTranslation; use Symfony\Contracts\Translation\TranslatorInterface; class OnePageCheckoutFormatter implements \FormFormatterInterface @@ -152,7 +151,7 @@ public function getFormat() ->setName('use_same_address') ->setType('checkbox') ->setLabel( - $this->translator->trans('Use the same address for invoice', [], ModuleTranslation::SHOP_DOMAIN) + $this->translator->trans('Use the same address for invoice', [], 'Modules.Onepagecheckout.Shop') ) ->setValue(true); diff --git a/src/Translation/ModuleTranslation.php b/src/Translation/ModuleTranslation.php deleted file mode 100644 index e42b89c..0000000 --- a/src/Translation/ModuleTranslation.php +++ /dev/null @@ -1,9 +0,0 @@ - + + + + + Allow faster checkout for higher conversion and spontaneous purchases. + Allow faster checkout for higher conversion and spontaneous purchases. + + + Before you proceed, please make sure that: + Before you proceed, please make sure that: + + + Change checkout appearance + Change checkout appearance + + + Check theme compatibility + Check theme compatibility + + + Checkout + Checkout + + + Checkout layout + Checkout layout + + + Checkout layout has been changed. Shop is now in maintenance mode. + Checkout layout has been changed. Shop is now in maintenance mode. + + + Four-page checkout + Four-page checkout + + + Increased conversion with a seamless and frictionless experience + Increased conversion with a seamless and frictionless experience + + + Maintenance mode + Maintenance mode + + + Mobile-friendly checkout + Mobile-friendly checkout + + + Native one-page checkout. + Native one-page checkout. + + + One-page checkout + One-page checkout + + + One-page checkout layout requires a Bootstrap 5-compatible theme. + One-page checkout layout requires a Bootstrap 5-compatible theme. + + + Propose a step-by-step checkout experience. All the usual payment steps will be displayed on different screens. Choose this method if: + Propose a step-by-step checkout experience. All the usual payment steps will be displayed on different screens. Choose this method if: + + + Propose the best checkout experience to your clients with the one-page layout. All the payment steps will be displayed in one page and let you benefit from: + Propose the best checkout experience to your clients with the one-page layout. All the payment steps will be displayed in one page and let you benefit from: + + + Recommended + Recommended + + + Reduced time spent, less clicks & no extra-step + Reduced time spent, less clicks & no extra-step + + + Unable to enable maintenance mode. Checkout layout was not changed. + Unable to enable maintenance mode. Checkout layout was not changed. + + + We strongly recommend enabling <strong>Maintenance Mode</strong> or testing this in a <strong>Staging Environment</strong> first to ensure a smooth transition for your customers. + We strongly recommend enabling <strong>Maintenance Mode</strong> or testing this in a <strong>Staging Environment</strong> first to ensure a smooth transition for your customers. + + + You are NOT using the "Classic" theme: This layout is incompatible with the legacy Classic theme and will break your storefront. + You are NOT using the "Classic" theme: This layout is incompatible with the legacy Classic theme and will break your storefront. + + + You need flexibility for complex or specific information + You need flexibility for complex or specific information + + + You want to integrate upsell & cross-sell strategies + You want to integrate upsell & cross-sell strategies + + + You're about to update the Checkout appearance of your store. + You're about to update the Checkout appearance of your store. + + + You're under regulatory compliance + You're under regulatory compliance + + + Your checkout modules are compatible. Some older modules may not be compatible with a one-page layout. + Your checkout modules are compatible. Some older modules may not be compatible with a one-page layout. + + + Your theme is compatible with the one-page checkout DOM and Bootstrap 5: Custom or third-party themes must support this new checkout architecture. + Your theme is compatible with the one-page checkout DOM and Bootstrap 5: Custom or third-party themes must support this new checkout architecture. + + + + diff --git a/translations/en-US/ModulesOnepagecheckoutShop.en-US.xlf b/translations/en-US/ModulesOnepagecheckoutShop.en-US.xlf new file mode 100644 index 0000000..a21bdcb --- /dev/null +++ b/translations/en-US/ModulesOnepagecheckoutShop.en-US.xlf @@ -0,0 +1,351 @@ + + + + + + -- please choose -- + -- please choose -- + + + Account successfully created + Account successfully created + + + Address details: + Address details: + + + Address options + Address options + + + Address successfully deleted. + Address successfully deleted. + + + Already have an account? Sign in + Already have an account? Sign in + + + An error occurred while loading addresses. Please try again. + An error occurred while loading addresses. Please try again. + + + An error occurred while loading carriers. Please try again. + An error occurred while loading carriers. Please try again. + + + An error occurred while loading payment methods. Please try again. + An error occurred while loading payment methods. Please try again. + + + An error occurred. Please try again. + An error occurred. Please try again. + + + Are you sure you want to delete this address? + Are you sure you want to delete this address? + + + Billing address + Billing address + + + Cancel + Cancel + + + Checkout + Checkout + + + Close + Close + + + Connected as + Connected as + + + Contact information + Contact information + + + Continue as guest + Continue as guest + + + Create account + Create account + + + Delete + Delete + + + Delete this address? + Delete this address? + + + Delivery address + Delivery address + + + Delivery method + Delivery method + + + Edit + Edit + + + Edit billing address + Edit billing address + + + Edit delivery address + Edit delivery address + + + Gift wrapping is currently unavailable. + Gift wrapping is currently unavailable. + + + I would like to receive my order in recycled packaging. + I would like to receive my order in recycled packaging. + + + If you sign out now, your cart will be emptied. + If you sign out now, your cart will be emptied. + + + If you'd like, you can add a note to the gift: + If you'd like, you can add a note to the gift: + + + Invalid delivery address. + Invalid delivery address. + + + Invalid email format. + Invalid email format. + + + Invalid security token. + Invalid security token. + + + Invoice address + Invoice address + + + Loading addresses... + Loading addresses... + + + Loading delivery methods... + Loading delivery methods... + + + Loading payment methods... + Loading payment methods... + + + Loading... + Loading... + + + Missing delivery option. + Missing delivery option. + + + Missing payment selection payload. + Missing payment selection payload. + + + My Address + My Address + + + My account + My account + + + New billing address + New billing address + + + New delivery address + New delivery address + + + Not you? + Not you? + + + One-page checkout is currently unavailable. + One-page checkout is currently unavailable. + + + One-page checkout is not enabled. + One-page checkout is not enabled. + + + Order summary + Order summary + + + Pay + Pay + + + Payment method + Payment method + + + Please accept the terms of service. + Please accept the terms of service. + + + Please select a payment method. + Please select a payment method. + + + Please select a shipping method. + Please select a shipping method. + + + Retry + Retry + + + Save + Save + + + Saving... + Saving... + + + Select address: %alias% + Select address: %alias% + + + Sign out + Sign out + + + State + State + + + This action will remove the selected address from your checkout. + This action will remove the selected address from your checkout. + + + Unable to delete address. + Unable to delete address. + + + Unable to initialize checkout customer. + Unable to initialize checkout customer. + + + Unable to initialize the selected payment method. + Unable to initialize the selected payment method. + + + Unable to load delivery methods. + Unable to load delivery methods. + + + Unable to load payment methods. + Unable to load payment methods. + + + Unable to load states. + Unable to load states. + + + Unable to load the requested address. + Unable to load the requested address. + + + Unable to refresh addresses. + Unable to refresh addresses. + + + Unable to resolve checkout customer. + Unable to resolve checkout customer. + + + Unable to resolve the current cart. + Unable to resolve the current cart. + + + Unable to resolve the current delivery address. + Unable to resolve the current delivery address. + + + Unable to save address. + Unable to save address. + + + Unable to select the delivery method. + Unable to select the delivery method. + + + Unable to select the payment method. + Unable to select the payment method. + + + Unable to submit checkout. + Unable to submit checkout. + + + Unable to synchronize cart customer link. + Unable to synchronize cart customer link. + + + Unable to update guest email. + Unable to update guest email. + + + Unfortunately, there are no carriers available for your delivery address. + Unfortunately, there are no carriers available for your delivery address. + + + Unfortunately, there are no payment method available. + Unfortunately, there are no payment method available. + + + Use a different delivery address + Use a different delivery address + + + Use the same address for invoice + Use the same address for invoice + + + Use this address for invoice too + Use this address for invoice too + + + Write a comment about this order + Write a comment about this order + + + Write your comment... + Write your comment... + + + You will see the available delivery methods once you've entered your delivery address. + You will see the available delivery methods once you've entered your delivery address. + + + You will see the available payment methods once you've entered your delivery address. + You will see the available payment methods once you've entered your delivery address. + + + + diff --git a/translations/en-US/index.php b/translations/en-US/index.php new file mode 100644 index 0000000..a7be738 --- /dev/null +++ b/translations/en-US/index.php @@ -0,0 +1,29 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/translations/fr-FR/ModulesOnepagecheckoutAdmin.fr-FR.xlf b/translations/fr-FR/ModulesOnepagecheckoutAdmin.fr-FR.xlf new file mode 100644 index 0000000..7a5acac --- /dev/null +++ b/translations/fr-FR/ModulesOnepagecheckoutAdmin.fr-FR.xlf @@ -0,0 +1,115 @@ + + + + + + Allow faster checkout for higher conversion and spontaneous purchases. + Permettez un paiement plus rapide pour augmenter la conversion et les achats spontanés. + + + Before you proceed, please make sure that: + Avant de continuer, veuillez vous assurer que : + + + Change checkout appearance + Modifier l'apparence du tunnel de commande + + + Check theme compatibility + Vérifier la compatibilité du thème + + + Checkout + Commande + + + Checkout layout + Mise en page du tunnel de commande + + + Checkout layout has been changed. Shop is now in maintenance mode. + La mise en page du tunnel de commande a été modifiée. La boutique est maintenant en mode maintenance. + + + Four-page checkout + Commande en quatre pages + + + Increased conversion with a seamless and frictionless experience + Une conversion accrue grâce à une expérience fluide et sans friction + + + Maintenance mode + Mode maintenance + + + Mobile-friendly checkout + Tunnel de commande adapté au mobile + + + Native one-page checkout. + Tunnel de commande natif en une page. + + + One-page checkout + Commande en une page + + + One-page checkout layout requires a Bootstrap 5-compatible theme. + La mise en page de la commande en une page nécessite un thème compatible Bootstrap 5. + + + Propose a step-by-step checkout experience. All the usual payment steps will be displayed on different screens. Choose this method if: + Proposez une expérience de commande étape par étape. Toutes les étapes de paiement habituelles seront affichées sur des écrans différents. Choisissez cette méthode si : + + + Propose the best checkout experience to your clients with the one-page layout. All the payment steps will be displayed in one page and let you benefit from: + Proposez la meilleure expérience de commande à vos clients avec la mise en page en une page. Toutes les étapes de paiement seront affichées sur une seule page et vous permettent de bénéficier de : + + + Recommended + Recommandé + + + Reduced time spent, less clicks & no extra-step + Moins de temps passé, moins de clics et aucune étape supplémentaire + + + Unable to enable maintenance mode. Checkout layout was not changed. + Impossible d'activer le mode maintenance. La mise en page du tunnel de commande n'a pas été modifiée. + + + We strongly recommend enabling <strong>Maintenance Mode</strong> or testing this in a <strong>Staging Environment</strong> first to ensure a smooth transition for your customers. + Nous vous recommandons vivement d'activer le <strong>mode maintenance</strong> ou de tester ceci d'abord dans un <strong>environnement de préproduction</strong> afin d'assurer une transition fluide pour vos clients. + + + You are NOT using the "Classic" theme: This layout is incompatible with the legacy Classic theme and will break your storefront. + Vous n'utilisez PAS le thème « Classic » : cette mise en page est incompatible avec l'ancien thème Classic et cassera votre boutique. + + + You need flexibility for complex or specific information + Vous avez besoin de flexibilité pour des informations complexes ou spécifiques + + + You want to integrate upsell & cross-sell strategies + Vous souhaitez intégrer des stratégies de vente incitative et de vente croisée + + + You're about to update the Checkout appearance of your store. + Vous êtes sur le point de modifier l'apparence du tunnel de commande de votre boutique. + + + You're under regulatory compliance + Vous êtes soumis à des obligations réglementaires + + + Your checkout modules are compatible. Some older modules may not be compatible with a one-page layout. + Vos modules de commande sont compatibles. Certains modules plus anciens peuvent ne pas être compatibles avec une mise en page en une page. + + + Your theme is compatible with the one-page checkout DOM and Bootstrap 5: Custom or third-party themes must support this new checkout architecture. + Votre thème est compatible avec le DOM de la commande en une page et Bootstrap 5 : les thèmes personnalisés ou tiers doivent prendre en charge cette nouvelle architecture de commande. + + + + diff --git a/translations/fr-FR/ModulesOnepagecheckoutShop.fr-FR.xlf b/translations/fr-FR/ModulesOnepagecheckoutShop.fr-FR.xlf new file mode 100644 index 0000000..66780cf --- /dev/null +++ b/translations/fr-FR/ModulesOnepagecheckoutShop.fr-FR.xlf @@ -0,0 +1,351 @@ + + + + + + -- please choose -- + -- veuillez choisir -- + + + Account successfully created + Compte créé avec succès + + + Address details: + Détails de l'adresse : + + + Address options + Options d'adresse + + + Address successfully deleted. + Adresse supprimée avec succès. + + + Already have an account? Sign in + Vous avez déjà un compte ? Connectez-vous + + + An error occurred while loading addresses. Please try again. + Une erreur s'est produite lors du chargement des adresses. Veuillez réessayer. + + + An error occurred while loading carriers. Please try again. + Une erreur s'est produite lors du chargement des transporteurs. Veuillez réessayer. + + + An error occurred while loading payment methods. Please try again. + Une erreur s'est produite lors du chargement des moyens de paiement. Veuillez réessayer. + + + An error occurred. Please try again. + Une erreur s'est produite. Veuillez réessayer. + + + Are you sure you want to delete this address? + Êtes-vous sûr de vouloir supprimer cette adresse ? + + + Billing address + Adresse de facturation + + + Cancel + Annuler + + + Checkout + Commander + + + Close + Fermer + + + Connected as + Connecté en tant que + + + Contact information + Coordonnées + + + Continue as guest + Continuer en tant qu'invité + + + Create account + Créez votre compte + + + Delete + Supprimer + + + Delete this address? + Supprimer cette adresse ? + + + Delivery address + Adresse de livraison + + + Delivery method + Mode de livraison + + + Edit + Modifier + + + Edit billing address + Modifier l'adresse de facturation + + + Edit delivery address + Modifier l'adresse de livraison + + + Gift wrapping is currently unavailable. + L'emballage cadeau est actuellement indisponible. + + + I would like to receive my order in recycled packaging. + J'accepte de recevoir ma commande dans un emballage recyclé + + + If you sign out now, your cart will be emptied. + Si vous vous déconnectez maintenant, votre panier sera vidé. + + + If you'd like, you can add a note to the gift: + Vous pouvez ajouter un message à votre cadeau : + + + Invalid delivery address. + Adresse de livraison invalide. + + + Invalid email format. + Format d'adresse e-mail invalide. + + + Invalid security token. + Jeton de sécurité invalide. + + + Invoice address + Adresse de facturation + + + Loading addresses... + Chargement des adresses... + + + Loading delivery methods... + Chargement des modes de livraison... + + + Loading payment methods... + Chargement des moyens de paiement... + + + Loading... + Chargement... + + + Missing delivery option. + Option de livraison manquante. + + + Missing payment selection payload. + Données de sélection du paiement manquantes. + + + My Address + Mon adresse + + + My account + Mon compte + + + New billing address + Nouvelle adresse de facturation + + + New delivery address + Nouvelle adresse de livraison + + + Not you? + Ce n'est pas vous ? + + + One-page checkout is currently unavailable. + La commande en une page est actuellement indisponible. + + + One-page checkout is not enabled. + La commande en une page n'est pas activée. + + + Order summary + Récapitulatif de commande + + + Pay + Payer + + + Payment method + Moyen de paiement + + + Please accept the terms of service. + Veuillez accepter les conditions générales de vente. + + + Please select a payment method. + Veuillez sélectionner un moyen de paiement. + + + Please select a shipping method. + Veuillez sélectionner un mode de livraison. + + + Retry + Réessayer + + + Save + Enregistrer + + + Saving... + Enregistrement... + + + Select address: %alias% + Sélectionner l'adresse : %alias% + + + Sign out + Déconnexion + + + State + État + + + This action will remove the selected address from your checkout. + Cette action supprimera l'adresse sélectionnée de votre commande. + + + Unable to delete address. + Impossible de supprimer l'adresse. + + + Unable to initialize checkout customer. + Impossible d'initialiser le client de la commande. + + + Unable to initialize the selected payment method. + Impossible d'initialiser le moyen de paiement sélectionné. + + + Unable to load delivery methods. + Impossible de charger les modes de livraison. + + + Unable to load payment methods. + Impossible de charger les moyens de paiement. + + + Unable to load states. + Impossible de charger les états. + + + Unable to load the requested address. + Impossible de charger l'adresse demandée. + + + Unable to refresh addresses. + Impossible d'actualiser les adresses. + + + Unable to resolve checkout customer. + Impossible de résoudre le client de la commande. + + + Unable to resolve the current cart. + Impossible de résoudre le panier actuel. + + + Unable to resolve the current delivery address. + Impossible de résoudre l'adresse de livraison actuelle. + + + Unable to save address. + Impossible d'enregistrer l'adresse. + + + Unable to select the delivery method. + Impossible de sélectionner le mode de livraison. + + + Unable to select the payment method. + Impossible de sélectionner le moyen de paiement. + + + Unable to submit checkout. + Impossible de valider la commande. + + + Unable to synchronize cart customer link. + Impossible de synchroniser l'association client-panier. + + + Unable to update guest email. + Impossible de mettre à jour l'e-mail de l'invité. + + + Unfortunately, there are no carriers available for your delivery address. + Il n'y a malheureusement aucun transporteur pouvant livrer à votre adresse. + + + Unfortunately, there are no payment method available. + Malheureusement, aucun moyen de paiement n'est disponible. + + + Use a different delivery address + Utiliser une adresse de livraison différente + + + Use the same address for invoice + Utiliser la même adresse pour la facturation + + + Use this address for invoice too + Utiliser aussi cette adresse pour la facturation + + + Write a comment about this order + Écrire un commentaire à propos de cette commande + + + Write your comment... + Écrivez votre commentaire... + + + You will see the available delivery methods once you've entered your delivery address. + Vous verrez les modes de livraison disponibles une fois votre adresse de livraison saisie. + + + You will see the available payment methods once you've entered your delivery address. + Vous verrez les moyens de paiement disponibles une fois votre adresse de livraison saisie. + + + + diff --git a/translations/fr-FR/index.php b/translations/fr-FR/index.php new file mode 100644 index 0000000..a7be738 --- /dev/null +++ b/translations/fr-FR/index.php @@ -0,0 +1,29 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/templates/front/checkout/_partials/one-page-checkout/address-fields.tpl b/views/templates/front/checkout/_partials/one-page-checkout/address-fields.tpl index 2e4dab0..b7d9690 100644 --- a/views/templates/front/checkout/_partials/one-page-checkout/address-fields.tpl +++ b/views/templates/front/checkout/_partials/one-page-checkout/address-fields.tpl @@ -61,7 +61,7 @@ id="field-{$field.name}" {if $field.required}required{/if} > - + {foreach from=$field.availableValues item="label" key="value"} {/foreach} diff --git a/views/templates/front/checkout/_partials/one-page-checkout/address-list.tpl b/views/templates/front/checkout/_partials/one-page-checkout/address-list.tpl index 88489eb..338e3df 100644 --- a/views/templates/front/checkout/_partials/one-page-checkout/address-list.tpl +++ b/views/templates/front/checkout/_partials/one-page-checkout/address-list.tpl @@ -27,7 +27,7 @@ id="opc-address-{if $prefix}invoice{else}delivery{/if}-{$_address_id}" value="{$_address_id}" {if $is_address_selected}checked{/if} - aria-label="{l s='Select address: %alias%' sprintf=['%alias%' => $address.alias] d='Shop.Theme.Actions'}" + aria-label="{l s='Select address: %alias%' sprintf=['%alias%' => $address.alias] d='Modules.Onepagecheckout.Shop'}" aria-describedby="opc-address-details-{$_address_id}" > @@ -37,7 +37,7 @@ {$address.alias}

- {l s='Address details:' d='Shop.Theme.Actions'} + {l s='Address details:' d='Modules.Onepagecheckout.Shop'} {$address.firstname} {$address.lastname}
{$address.address1}{if $address.address2} {$address.address2}{/if}
{$address.postcode} {$address.city} @@ -51,7 +51,7 @@ class="btn p-0" data-bs-toggle="dropdown" aria-expanded="false" - aria-label="{l s='Address options' d='Shop.Theme.Actions'}" + aria-label="{l s='Address options' d='Modules.Onepagecheckout.Shop'}" > more_vert @@ -78,7 +78,7 @@ data-phone="{$address.phone|escape:'html':'UTF-8'}" data-address="{$address|@json_encode|escape:'htmlall':'UTF-8'}" > - {l s='Edit' d='Shop.Theme.Actions'} + {l s='Edit' d='Modules.Onepagecheckout.Shop'}

  • @@ -87,9 +87,9 @@ class="dropdown-item link-danger js-delete-address" data-id-address="{$_address_id}" data-address-type="{if $prefix == 'invoice_'}invoice{else}delivery{/if}" - data-confirm-message="{l s='Are you sure you want to delete this address?' d='Shop.Theme.Checkout'}" + data-confirm-message="{l s='Are you sure you want to delete this address?' d='Modules.Onepagecheckout.Shop'}" > - {l s='Delete' d='Shop.Theme.Actions'} + {l s='Delete' d='Modules.Onepagecheckout.Shop'}
  • @@ -118,7 +118,7 @@
    diff --git a/views/templates/front/checkout/_partials/one-page-checkout/address-modal.tpl b/views/templates/front/checkout/_partials/one-page-checkout/address-modal.tpl index a71ce65..6feba81 100644 --- a/views/templates/front/checkout/_partials/one-page-checkout/address-modal.tpl +++ b/views/templates/front/checkout/_partials/one-page-checkout/address-modal.tpl @@ -49,7 +49,7 @@ id="{$modal_id}-field-id_country" {if $formFields[$_key_id_country].required}required{/if} > - + {foreach from=$formFields[$_key_id_country].availableValues item="label" key="value"} {/foreach} @@ -75,15 +75,15 @@ {if isset($formFields[$_key_city])}{form_field field=$formFields[$_key_city]}{/if}
    {/if} @@ -98,7 +98,7 @@ prefix='invoice_' {if !$is_virtual_cart}