diff --git a/CHANGELOG.md b/CHANGELOG.md index 2921d8e7..ce0e8497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,35 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). +## [3.2.0](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.1.1...v3.2.0) - 2021-04-29 +**BREAKING CHANGES** +Whitelabel project changes: + +### Added +- Added BrandConfigurationService. Integration should register PacklinkConfigurationService instance for Packlink brand or adequate implementation for other brand(s) during the bootstraping. +- Added PacklinkConfigurationService. +- Added FileResolverService. Integration should initialize FileResolverService with an array of folders where source files should be searched for. +- Added new method getLabels to \Packlink\BusinessLogic\CountryLabels\CountryService. + +### Changed + +- \Packlink\BusinessLogic\Language\TranslationService renamed to CountryService. +- TranslationService::translate renamed to CountryService::getText. +- Files from Resources/lang moved to Resources/countries. In integration, change path to translations to fit new folder names in core. +- Configuration::getCurrentLanguage and Configuration::setCurrentLanguage changed to Configuration::getUICountryCode and Configuration::setUICountryCode. + +Following changes will work properly once BrandConfigurationService is registered in Bootstrap: +- Removed hardcoded source value from ShippingServiceSearch. +- Removed hardcoded platform code from Proxy, Draft and RegistrationRequest. +- Removed platform country code from RegisterModalController.js. +- Added platform_country to RegistrationController:getRegisterData response. +- RegisterController.js function populateInitialValues() populates platform_country. +- Registration link and platform country removed from CountryService::$supportedCountries. +- Removed Packlink\BusinessLogic\Country\RegistrationCountry. +- Added validation for platform country in RegistrationRequest::doValidate and UserAccountService::initializeUser. +- Removed $supportedCountries from CountryService and WarehouseCountryService. +- Packlink\BusinessLogic\Language\TranslationService renamed to CountryService and moved to CountryLabels directory. + ## [3.1.1](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.1.0...v3.1.1) - 2021-03-26 ### Added - Added additional ISO codes to the postal code transformer. diff --git a/composer.json b/composer.json index 6142cf94..b7c42ab4 100755 --- a/composer.json +++ b/composer.json @@ -10,13 +10,15 @@ "autoload": { "psr-4": { "Logeecom\\Infrastructure\\": "src/Infrastructure", - "Packlink\\BusinessLogic\\": "src/BusinessLogic" + "Packlink\\BusinessLogic\\": "src/BusinessLogic", + "Packlink\\Brands\\": "src/Brands" } }, "autoload-dev": { "psr-4": { "Logeecom\\Tests\\Infrastructure\\": "tests/Infrastructure", - "Logeecom\\Tests\\BusinessLogic\\": "tests/BusinessLogic" + "Logeecom\\Tests\\BusinessLogic\\": "tests/BusinessLogic", + "Logeecom\\Tests\\Brands\\": "tests/Brands" } }, "require-dev": { diff --git a/src/Brands/Packlink/PacklinkConfigurationService.php b/src/Brands/Packlink/PacklinkConfigurationService.php new file mode 100644 index 00000000..4b6f390a --- /dev/null +++ b/src/Brands/Packlink/PacklinkConfigurationService.php @@ -0,0 +1,149 @@ + array( + 'code' => 'ES', + 'postal_code' => '28001', + ), + 'DE' => array( + 'code' => 'DE', + 'postal_code' => '10115', + ), + 'FR' => array( + 'code' => 'FR', + 'postal_code' => '75001', + ), + 'IT' => array( + 'code' => 'IT', + 'postal_code' => '00118', + ), + 'AT' => array( + 'code' => 'AT', + 'postal_code' => '1010', + ), + 'NL' => array( + 'code' => 'NL', + 'postal_code' => '1011', + ), + 'BE' => array( + 'code' => 'BE', + 'postal_code' => '1000', + ), + 'PT' => array( + 'code' => 'PT', + 'postal_code' => '1000-017', + ), + 'TR' => array( + 'code' => 'TR', + 'postal_code' => '06010', + ), + 'IE' => array( + 'code' => 'IE', + 'postal_code' => 'D1', + ), + 'GB' => array( + 'code' => 'GB', + 'postal_code' => 'E1 6AN', + ), + 'HU' => array( + 'code' => 'HU', + 'postal_code' => '1014', + ), + ); + /** + * List of countries available only for warehouse selection. + * + * @var array + */ + protected static $additionalWarehouseCountries = array( + 'PL' => array( + 'code' => 'PL', + 'postal_code' => '00-694', + ), + 'CH' => array( + 'code' => 'CH', + 'postal_code' => '3000', + ), + 'LU' => array( + 'code' => 'LU', + 'postal_code' => '1009', + ), + 'AR' => array( + 'code' => 'AR', + 'postal_code' => 'C1258 AAA', + ), + 'US' => array( + 'code' => 'US', + 'postal_code' => '01223', + ), + 'BO' => array( + 'code' => 'BO', + 'postal_code' => 'La Paz', + ), + 'MX' => array( + 'code' => 'MX', + 'postal_code' => '21900', + ), + 'CL' => array( + 'code' => 'CL', + 'postal_code' => '7500599', + ), + 'CZ' => array( + 'code' => 'CZ', + 'postal_code' => '186 00', + ), + 'SE' => array( + 'code' => 'SE', + 'postal_code' => '103 16', + ), + ); + + /** + * @inheritDoc + */ + public function get() + { + $brandConfiguration = new BrandConfiguration(); + + $brandConfiguration->platformCode = 'PRO'; + $brandConfiguration->shippingServiceSource = 'PRO'; + $brandConfiguration->platformCountries = static::$supportedPlatformCountries; + $brandConfiguration->registrationCountries = static::$supportedRegistrationCountries; + $brandConfiguration->warehouseCountries = array_merge( + static::$supportedRegistrationCountries, + static::$additionalWarehouseCountries + ); + + return $brandConfiguration; + } +} diff --git a/src/Brands/Packlink/Resources/countries/at.json b/src/Brands/Packlink/Resources/countries/at.json new file mode 100644 index 00000000..80e17cfc --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/at.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/de/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/de/articles/360010011480" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/be.json b/src/Brands/Packlink/Resources/countries/be.json new file mode 100644 index 00000000..07d4b919 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/be.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/nl/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/nl/articles/360010011560" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/de.json b/src/Brands/Packlink/Resources/countries/de.json new file mode 100644 index 00000000..c019d902 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/de.json @@ -0,0 +1,57 @@ +{ + "general": { + "packlinkPro": "Packlink PRO Shipping", + "saveUp": "Sparen Sie bis zu 70% bei Ihren Versandkosten. Keine festen Gebühren, kein Mindestvolumen beim Versand. Verwalten Sie alle Ihre Sendungen auf einer einzigen Plattform.", + "packlinkShipping": "Packlink Shipping S.L.", + "noContract": "Ohne Vertragsbindung – Sofortiger Zugriff auf über 300 Versanddienste in einer einzigen Plattform. Verbinden Sie Ihren Onlineshop und steuern Sie alle Sendungen über Packlink PRO.", + "developedAndManaged": "Entwickelt und verwaltet von Packlink" + }, + "login": { + "welcome": "Willkommen zu Packlink PRO", + "connectYourService": "Verbinden Sie Ihren Dienst, indem Sie Ihren API-Schlüssel verwenden. Sie finden ihn unter
„Packlink Pro API-Schlüssel“ bei den „Einstellungen“." + }, + "register": { + "startEnjoying": "Genießen Sie ab jetzt Packlink PRO!", + "termsAndConditions": "
Ich akzeptiere die Nutzungsbedingungen und die Datenschutzerklärung von Packlink
", + "termsAndConditionsUrl": "https://pro.packlink.de/agb/", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/de/articles/360010011560-Datenschutzerklarung-der-Packlink-Shipping-S-L-", + "marketingEmails": "Ich ermächtige Packlink Shipping S.L., mir kommerzielle Mitteilungen per E-Mail zuzusenden" + }, + "configuration": { + "helpUrl": "https://support-pro.packlink.com/hc/de", + "contactUrl": "business@packlink.com", + "contactUrlMail": "mailto::business@packlink.com" + }, + "orderStatusMapping": { + "description": "Mit Packlink können Sie Ihren %s Bestellstatus mit Versandinformationen aktualisieren.
Sie können die Informationen jederzeit bearbeiten.", + "packlinkProShipmentStatus": "VERSANDSTATUS von Packlink PRO" + }, + "shippingServices": { + "packlinkPrices": "Packlink-Preise", + "pricePolicyDescription": "Standardmäßig werden die Packlink Basispreise eingestellt sein. Sie können diese jedoch weiter unten genauer konfigurieren.", + "packlinkPrice": "Packlink-Preise", + "percentagePacklinkPrices": "% der Packlink-Preise", + "percentagePacklinkPricesWithData": "% der Packlink-Preise: %s von %s%", + "usePacklinkRange": "Für alle anderen Bereiche gelten die Packlink-Preise" + }, + "orderListAndDetails": { + "packlinkOrderDraft": "Packlink Auftragsentwurf", + "printShipmentLabels": "Packlink PRO Versandetiketten drucken", + "packlinkReferenceNumber": "Packlink Referenznummer", + "packlinkShippingPrice": "Packlink Versandpreis", + "viewOnPacklink": "Auf Packlink PRO ansehen", + "draftIsBeingCreated": "Der Entwurf wird gerade in Packlink PRO erstellt", + "createOrderDraft": "Entwurf der Bestellung in Packlink PRO erstellen", + "packlinkShipping": "Packlink Shipping", + "sendWithPacklink": "Send with Packlink", + "shipmentUrl": "https://pro.packlink.de/private/shipments/" + }, + "systemLogMessages": { + "webhookReceived": "Webhook von Packlink erhalten" + }, + "autoTest": { + "moduleAutoTest": "Automatischer Test PacklinkPRO-Modul", + "useThisPageTestConfiguration": "Auf dieser Seite können Sie die Systemkonfiguration und die Dienste des PacklinkPRO-Moduls testen.", + "openModule": "PacklinkPRO-Modul öffnen" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/en.json b/src/Brands/Packlink/Resources/countries/en.json new file mode 100644 index 00000000..260db8b5 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/en.json @@ -0,0 +1,57 @@ +{ + "general": { + "packlinkPro": "Packlink PRO Shipping", + "saveUp": "Save up to 70% on your shipping costs. No fixed fees, no minimum shipping volume required. Manage all your shipments in a single platform.", + "packlinkShipping": "Packlink Shipping S.L.", + "noContract": "No contract needed! More than 300 transport services into a single platform. You can connect all your ecommerce and manage all your shipments in Packlink PRO.", + "developedAndManaged": "Developed and managed by Packlink" + }, + "login": { + "welcome": "Welcome to Packlink PRO", + "connectYourService": "Connect your service using your key. You'll find it in the
\"Packlink Pro API Key\" section of the \"Settings\"." + }, + "register": { + "startEnjoying": "Start enjoying Packlink PRO!", + "termsAndConditions": "
I accept the Terms of Service and the Privacy Policy of Packlink
", + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011560", + "marketingEmails": "I authorise Packlink Shipping S.L. to send me commercial communications by e-mail" + }, + "configuration": { + "helpUrl": "https://support-pro.packlink.com/hc/en-gb", + "contactUrl": "business@packlink.com", + "contactUrlMail": "mailto::business@packlink.com" + }, + "orderStatusMapping": { + "description": "With Packlink you can update your %s order status with shipping information.
You can edit it at any time.", + "packlinkProShipmentStatus": "Packlink PRO SHIPMENT STATUS" + }, + "shippingServices": { + "packlinkPrices": "Packlink prices", + "pricePolicyDescription": "The default will be Packlink's basic prices. But you can configure these in a more precise way below.", + "packlinkPrice": "Packlink Price", + "percentagePacklinkPrices": "% of Packlink prices", + "percentagePacklinkPricesWithData": "% of Packlink prices: %s by %s%", + "usePacklinkRange": "For all other ranges, apply Packlink prices" + }, + "orderListAndDetails": { + "packlinkOrderDraft": "Packlink order draft", + "printShipmentLabels": "Print Packlink PRO Shipment Labels", + "packlinkReferenceNumber": "Packlink reference number", + "packlinkShippingPrice": "Packlink shipping price", + "viewOnPacklink": "View on Packlink PRO", + "draftIsBeingCreated": "Draft is currently being created in Packlink PRO", + "createOrderDraft": "Create order draft in Packlink PRO", + "packlinkShipping": "Packlink Shipping", + "sendWithPacklink": "Send with Packlink", + "shipmentUrl": "https://pro.packlink.com/private/shipments/" + }, + "systemLogMessages": { + "webhookReceived": "Webhook from Packlink received." + }, + "autoTest": { + "moduleAutoTest": "PacklinkPRO module auto-test", + "useThisPageTestConfiguration": "Use this page to test the system configuration and PacklinkPRO module services.", + "openModule": "Open PacklinkPRO module" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/es.json b/src/Brands/Packlink/Resources/countries/es.json new file mode 100644 index 00000000..8b7494d3 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/es.json @@ -0,0 +1,57 @@ +{ + "general": { + "packlinkPro": "Packlink PRO Shipping", + "saveUp": "Ahorra hasta un 70% en tus gastos de envío. Sin tarifas fijas, sin volumen de envíos mínimo. Gestiona todos tus envíos en una sola plataforma.", + "packlinkShipping": "Packlink Shipping S.L.", + "noContract": "Sin contratos, accede inmediatamente a más de 300 servicios de transporte en una única plataforma. No importa cuantos puntos de venta tengas, todo lo podrás gestionar desde Packlink PRO.", + "developedAndManaged": "Desarrollado y gestionado por Packlink" + }, + "login": { + "welcome": "Te damos la bienvenida a Packlink PRO", + "connectYourService": "Conecta tu servicio mediante tu clave. La encontrarás en la
sección \"Configuración\" apartado \"Packlink Pro API Key\"" + }, + "register": { + "startEnjoying": "¡Empieza a disfrutar de Packlink PRO!", + "termsAndConditions": "
Acepto los Términos y condiciones y la Política de privacidad de Packlink
", + "termsAndConditionsUrl": "https://pro.packlink.es/terminos-y-condiciones/", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/es-es/articles/360010011560-Poitica-de-Privacidad", + "marketingEmails": "Autorizo a Packlink Shipping S.L. a enviarme información comercial por correo electrónico" + }, + "configuration": { + "helpUrl": "https://support-pro.packlink.com/hc/es-es", + "contactUrl": "business@packlink.com", + "contactUrlMail": "mailto::business@packlink.com" + }, + "orderStatusMapping": { + "description": "Con Packlink puedes actualizar el estado de tu pedido de %s con la información de envío.
Puedes editarla en cualquier momento.", + "packlinkProShipmentStatus": "ESTADO DEL ENVÍO de Packlink PRO" + }, + "shippingServices": { + "packlinkPrices": "Precios de Packlink", + "pricePolicyDescription": "Por defecto serán los precios base de Packlink. Pero puedes configurarlos de manera más precisa a continuación.", + "packlinkPrice": "Precio Packlink", + "percentagePacklinkPrices": "% de los precio de Packlink", + "percentagePacklinkPricesWithData": "% de los precio de Packlink: %s por %s%", + "usePacklinkRange": "Para el resto de rangos, aplicar precios Packlink" + }, + "orderListAndDetails": { + "packlinkOrderDraft": "Borrador del pedido de Packlink", + "printShipmentLabels": "Imprimir Packlink PRO etiquetas de los envíos", + "packlinkReferenceNumber": "Número de referencia Packlink", + "packlinkShippingPrice": "Precio de envío de Packlink", + "viewOnPacklink": "Ver en Packlink PRO", + "draftIsBeingCreated": "El borrador se está creando actualmente en Packlink PRO", + "createOrderDraft": "Crear borrador en Packlink PRO", + "packlinkShipping": "Packlink Shipping", + "sendWithPacklink": "Send with Packlink", + "shipmentUrl": "https://pro.packlink.es/private/shipments/" + }, + "systemLogMessages": { + "webhookReceived": "Webhook de Packlink recibido" + }, + "autoTest": { + "moduleAutoTest": "Prueba automática del módulo PacklinkPRO", + "useThisPageTestConfiguration": "Utiliza esta página para probar la configuración del sistema y los servicios del módulo PacklinkPRO.", + "openModule": "Abrir el módulo PacklinkPRO" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/fr.json b/src/Brands/Packlink/Resources/countries/fr.json new file mode 100644 index 00000000..b7d264c2 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/fr.json @@ -0,0 +1,57 @@ +{ + "general": { + "packlinkPro": "Packlink PRO Shipping", + "saveUp": "Économisez jusqu'à 70% sur vos coûts de livraison. Sans frais fixes, sans volume minimum requis. Gérez tous vos envois depuis une seule plateforme.", + "packlinkShipping": "Packlink Shipping S.L.", + "noContract": "Sans engagement, accédez immédiatement à plus de 300 services de transport sur une seule et unique plateforme. Quelque soit le nombre de points de ventes que vous avez, vous pourrez tout gérer depuis Packlink PRO.", + "developedAndManaged": "Développé et géré par Packlink" + }, + "login": { + "welcome": "Bienvenue sur Packlink PRO", + "connectYourService": "Connectez votre service en utilisant votre clé. Vous la trouverez dans la section
« Clé API Packlink Pro » dans « Paramètres »." + }, + "register": { + "startEnjoying": "Commencez à utiliser Packlink PRO !", + "termsAndConditions": "
IJ’accepte les Conditions de service et la Politique de confidentialité de Packlink
", + "termsAndConditionsUrl": "https://pro.packlink.fr/conditions-generales/", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/fr-fr/articles/360010011560-Politique-de-confidentialite", + "marketingEmails": "J’autorise Packlink Shipping S.L. à m’envoyer des communications commerciales par courriel" + }, + "configuration": { + "helpUrl": "https://support-pro.packlink.com/hc/fr-fr", + "contactUrl": "business@packlink.com", + "contactUrlMail": "mailto::business@packlink.com" + }, + "orderStatusMapping": { + "description": "Avec Packlink, vous pouvez mettre à jour le statut de votre commande %s avec les informations d’expédition.
Vous pourrez les modifier à tout moment.", + "packlinkProShipmentStatus": "STATUT DE LIVRAISON Packlink PRO" + }, + "shippingServices": { + "packlinkPrices": "Prix Packlink", + "pricePolicyDescription": "Les tarifs de base de Packlink seront configurés par défaut, mais vous pourrez les configurer plus en détail ci-dessous.", + "packlinkPrice": "Prix Packlink", + "percentagePacklinkPrices": "% des prix Packlink", + "percentagePacklinkPricesWithData": "% des prix Packlink : %s de %s%", + "usePacklinkRange": "Pour toutes les autres fourchettes, appliquez les prix Packlink" + }, + "orderListAndDetails": { + "packlinkOrderDraft": "Brouillon de commande Packlink", + "printShipmentLabels": "Imprimer les étiquettes de livraison Packlink PRO", + "packlinkReferenceNumber": "Numéro de référence Packlink", + "packlinkShippingPrice": "Prix de livraison Packlink", + "viewOnPacklink": "Voir sur Packlink PRO", + "draftIsBeingCreated": "Le brouillon est en cours de création sur Packlink PRO", + "createOrderDraft": "Créer un brouillon de commande sur Packlink PRO", + "packlinkShipping": "Packlink Shipping", + "sendWithPacklink": "Send with Packlink", + "shipmentUrl": "https://pro.packlink.fr/private/shipments/" + }, + "systemLogMessages": { + "webhookReceived": "Webhook de Packlink reçu" + }, + "autoTest": { + "moduleAutoTest": "Test automatique du module PacklinkPRO", + "useThisPageTestConfiguration": "Utilisez cette page pour tester la configuration du système et les services du module PacklinkPRO.", + "openModule": "Ouvrir le module PacklinkPRO" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/gb.json b/src/Brands/Packlink/Resources/countries/gb.json new file mode 100644 index 00000000..0f805ad4 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/gb.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011560" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/hu.json b/src/Brands/Packlink/Resources/countries/hu.json new file mode 100644 index 00000000..82f12c8c --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/hu.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/hu/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/hu/articles/360010011560" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/ie.json b/src/Brands/Packlink/Resources/countries/ie.json new file mode 100644 index 00000000..0f805ad4 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/ie.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011560" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/it.json b/src/Brands/Packlink/Resources/countries/it.json new file mode 100644 index 00000000..d1e1973f --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/it.json @@ -0,0 +1,57 @@ +{ + "general": { + "packlinkPro": "Packlink PRO Shipping", + "saveUp": "Risparmia fino a un 70% sui costi di spedizione. Senza costi fissi né volumi minimi di spedizione richiesti. Gestisci tutte le tue spedizioni da un'unica piattaforma.", + "packlinkShipping": "Packlink Shipping S.L.", + "noContract": "Senza contratti, accedi suvito a più di 300 servizi di trasporto da un'unica piattaforma. Indipendentemente da quanti punti vendita hai, puoi gestirli tutto da Packlink PRO.", + "developedAndManaged": "Sviluppato e gestito da Packlink" + }, + "login": { + "welcome": "Benvenuto a Packlink PRO", + "connectYourService": "Usa la chiave per collegare il tuo servizio. La troverai nella sezione
\"Chiave API Packlink Pro\" delle \"Impostazioni\"." + }, + "register": { + "startEnjoying": "Inizia a usufruire di Packlink PRO!", + "termsAndConditions": "
Accetto i Termini del servizio e l’Informativa sulla privacy di Packlink
", + "termsAndConditionsUrl": "https://pro.packlink.it/termini-condizioni/", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/it/articles/360010011560-Politica-di-Privacy", + "marketingEmails": "Autorizzo Packlink Shipping S.L. a inviarmi comunicazioni commerciali via email" + }, + "configuration": { + "helpUrl": "https://support-pro.packlink.com/hc/it", + "contactUrl": "business@packlink.com", + "contactUrlMail": "mailto::business@packlink.com" + }, + "orderStatusMapping": { + "description": "Con Packlink, puoi aggiornare lo stato dell’ordine %s con i dati della spedizione.
Puoi modificarlo ogni volta che vuoi.", + "packlinkProShipmentStatus": "STATO DELLA SPEDIZIONE di Packlink PRO" + }, + "shippingServices": { + "packlinkPrices": "Prezzi di Packlink", + "pricePolicyDescription": "Per impostazione predefinita, saranno i prezzi di base di Packlink, ma puoi configurarli più dettagliatamente qui di seguito.", + "packlinkPrice": "Prezzo di Packlink", + "percentagePacklinkPrices": "% dei prezzi di Packlink", + "percentagePacklinkPricesWithData": "% dei prezzi di Packlink: %s del %s%", + "usePacklinkRange": "Per tutti gli altri range, applica i prezzi di Packlink" + }, + "orderListAndDetails": { + "packlinkOrderDraft": "Bozza dell'ordine Packlink", + "printShipmentLabels": "Stampa etichette di spedizione Packlink PRO", + "packlinkReferenceNumber": "Numero di ordine Packlink", + "packlinkShippingPrice": "PPrezzo di spedizione Packlink", + "viewOnPacklink": "Vedi su Packlink PRO", + "draftIsBeingCreated": "La bozza è attualmente in fase di creazione su Packlink PRO", + "createOrderDraft": "Crea una bozza di ordine su Packlink PRO", + "packlinkShipping": "Packlink Shipping", + "sendWithPacklink": "Send with Packlink", + "shipmentUrl": "https://pro.packlink.it/private/shipments/" + }, + "systemLogMessages": { + "webhookReceived": "Webhook di Packlink ricevuto" + }, + "autoTest": { + "moduleAutoTest": "Auto-test per il modulo di PacklinkPRO", + "useThisPageTestConfiguration": "Usa questa pagina per testare la configurazione del sistema e i servizi del modulo di PacklinkPRO.", + "openModule": "Apri il modulo di PacklinkPRO" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/nl.json b/src/Brands/Packlink/Resources/countries/nl.json new file mode 100644 index 00000000..07d4b919 --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/nl.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/nl/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/nl/articles/360010011560" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/pt.json b/src/Brands/Packlink/Resources/countries/pt.json new file mode 100644 index 00000000..a4a65b0f --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/pt.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/pt/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/pt/articles/360010011560" + } +} \ No newline at end of file diff --git a/src/Brands/Packlink/Resources/countries/tr.json b/src/Brands/Packlink/Resources/countries/tr.json new file mode 100644 index 00000000..ea17d41a --- /dev/null +++ b/src/Brands/Packlink/Resources/countries/tr.json @@ -0,0 +1,6 @@ +{ + "register": { + "termsAndConditionsUrl": "https://support-pro.packlink.com/hc/tr/articles/360010011480", + "privacyPolicyUrl": "https://support-pro.packlink.com/hc/tr/articles/360010011560" + } +} \ No newline at end of file diff --git a/src/BusinessLogic/BootstrapComponent.php b/src/BusinessLogic/BootstrapComponent.php index 4fb94eaa..2c9bbb73 100644 --- a/src/BusinessLogic/BootstrapComponent.php +++ b/src/BusinessLogic/BootstrapComponent.php @@ -12,14 +12,14 @@ use Packlink\BusinessLogic\Controllers\ShippingMethodController; use Packlink\BusinessLogic\Country\Country; use Packlink\BusinessLogic\Country\CountryService; -use Packlink\BusinessLogic\Country\RegistrationCountry; use Packlink\BusinessLogic\Country\WarehouseCountryService; use Packlink\BusinessLogic\DTO\FrontDtoFactory; use Packlink\BusinessLogic\DTO\ValidationError; +use Packlink\BusinessLogic\FileResolver\FileResolverService; use Packlink\BusinessLogic\Http\DTO\ParcelInfo; use Packlink\BusinessLogic\Http\Proxy; -use Packlink\BusinessLogic\Language\Interfaces\TranslationService as TranslationServiceInterface; -use Packlink\BusinessLogic\Language\TranslationService; +use Packlink\BusinessLogic\CountryLabels\Interfaces\CountryService as LabelServiceInterface; +use Packlink\BusinessLogic\CountryLabels\CountryService as CountryLabelService; use Packlink\BusinessLogic\Location\LocationService; use Packlink\BusinessLogic\Order\OrderService; use Packlink\BusinessLogic\OrderShipmentDetails\OrderShipmentDetailsService; @@ -171,9 +171,24 @@ function () { ); ServiceRegister::registerService( - TranslationServiceInterface::CLASS_NAME, + FileResolverService::CLASS_NAME, function () { - return new TranslationService(); + return new FileResolverService( + array( + __DIR__ . '/../Brands/Packlink/Resources/countries', + __DIR__ . '/Resources/countries', + ) + ); + } + ); + + ServiceRegister::registerService( + LabelServiceInterface::CLASS_NAME, + function () { + /** @var FileResolverService $fileResolverService */ + $fileResolverService = ServiceRegister::getService(FileResolverService::CLASS_NAME); + + return new CountryLabelService($fileResolverService); } ); @@ -217,7 +232,6 @@ protected static function initDtoRegistry() FrontDtoFactory::register(ParcelInfo::CLASS_KEY, ParcelInfo::CLASS_NAME); FrontDtoFactory::register(DashboardStatus::CLASS_KEY, DashboardStatus::CLASS_NAME); FrontDtoFactory::register(Country::CLASS_KEY, Country::CLASS_NAME); - FrontDtoFactory::register(RegistrationCountry::CLASS_KEY, RegistrationCountry::CLASS_NAME); FrontDtoFactory::register(RegistrationRequest::CLASS_KEY, RegistrationRequest::CLASS_NAME); FrontDtoFactory::register(RegistrationLegalPolicy::CLASS_KEY, RegistrationLegalPolicy::CLASS_NAME); FrontDtoFactory::register(ShippingPricePolicy::CLASS_KEY, ShippingPricePolicy::CLASS_NAME); diff --git a/src/BusinessLogic/Brand/BrandConfigurationService.php b/src/BusinessLogic/Brand/BrandConfigurationService.php new file mode 100644 index 00000000..a5f4b049 --- /dev/null +++ b/src/BusinessLogic/Brand/BrandConfigurationService.php @@ -0,0 +1,26 @@ + $this->platformCode, + 'shipping_service_source' => $this->shippingServiceSource, + 'platform_countries' => $this->platformCountries, + 'registration_countries' => $this->registrationCountries, + 'warehouse_countries' => $this->warehouseCountries, + ); + } + + /** + * Creates BrandConfiguration object from array. + * + * @param array $data + * + * @return BrandConfiguration + */ + public static function fromArray(array $data) + { + $result = new static(); + + $result->platformCode = $data['platform_code']; + $result->shippingServiceSource = $data['shipping_service_source']; + + if (isset($data['platform_countries']) && is_array($data['platform_countries'])) { + $result->platformCountries = $data['platform_countries']; + } else { + $result->platformCountries = array(); + } + + if (isset($data['registration_countries']) && is_array($data['registration_countries'])) { + $result->registrationCountries = $data['registration_countries']; + } else { + $result->registrationCountries = array(); + } + + if (isset($data['warehouse_countries']) && is_array($data['warehouse_countries'])) { + $result->warehouseCountries = $data['warehouse_countries']; + } else { + $result->warehouseCountries = array(); + } + + return $result; + } +} diff --git a/src/BusinessLogic/Brand/Exceptions/PlatformCountryNotSupportedByBrandException.php b/src/BusinessLogic/Brand/Exceptions/PlatformCountryNotSupportedByBrandException.php new file mode 100644 index 00000000..e3447abc --- /dev/null +++ b/src/BusinessLogic/Brand/Exceptions/PlatformCountryNotSupportedByBrandException.php @@ -0,0 +1,16 @@ + 'https://support-pro.packlink.com/hc/en-gb', - 'ES' => 'https://support-pro.packlink.com/hc/es-es', - 'DE' => 'https://support-pro.packlink.com/hc/de', - 'FR' => 'https://support-pro.packlink.com/hc/fr-fr', - 'IT' => 'https://support-pro.packlink.com/hc/it', - ); - - /** - * @return mixed|string + * @return string */ public function getHelpLink() { $lang = UrlService::getUrlLocaleKey(); - if (!array_key_exists($lang, static::$helpUrls)) { - $lang = 'EN'; - } + /** @var CountryService $countryService */ + $countryService = ServiceRegister::getService(CountryService::CLASS_NAME); - return static::$helpUrls[$lang]; + return $countryService->getLabel(strtolower($lang), 'configuration.helpUrl'); } } diff --git a/src/BusinessLogic/Controllers/RegistrationController.php b/src/BusinessLogic/Controllers/RegistrationController.php index 89216b05..b4226a49 100644 --- a/src/BusinessLogic/Controllers/RegistrationController.php +++ b/src/BusinessLogic/Controllers/RegistrationController.php @@ -4,7 +4,9 @@ use Logeecom\Infrastructure\Configuration\Configuration; use Logeecom\Infrastructure\ServiceRegister; +use Packlink\BusinessLogic\Brand\BrandConfigurationService; use Packlink\BusinessLogic\DTO\FrontDtoFactory; +use Packlink\BusinessLogic\CountryLabels\Interfaces\CountryService; use Packlink\BusinessLogic\Registration\RegistrationInfoService; use Packlink\BusinessLogic\Registration\RegistrationRequest; use Packlink\BusinessLogic\Registration\RegistrationService; @@ -15,51 +17,19 @@ class RegistrationController /** * string */ - const DEFAULT_COUNTRY = 'ES'; + const DEFAULT_COUNTRY = 'es'; /** * @var Configuration */ protected $configService; /** - * List of terms and conditions URLs for different country codes. - * - * @var array + * @var BrandConfigurationService */ - private static $termsAndConditionsUrls = array( - 'EN' => 'https://support-pro.packlink.com/hc/en-gb/articles/360010011480', - 'ES' => 'https://pro.packlink.es/terminos-y-condiciones/', - 'DE' => 'https://pro.packlink.de/agb/', - 'FR' => 'https://pro.packlink.fr/conditions-generales/', - 'IT' => 'https://pro.packlink.it/termini-condizioni/', - 'AT' => 'https://support-pro.packlink.com/hc/de/articles/360010011480', - 'NL' => 'https://support-pro.packlink.com/hc/nl/articles/360010011480', - 'BE' => 'https://support-pro.packlink.com/hc/nl/articles/360010011480', - 'PT' => 'https://support-pro.packlink.com/hc/pt/articles/360010011480', - 'TR' => 'https://support-pro.packlink.com/hc/tr/articles/360010011480', - 'IE' => 'https://support-pro.packlink.com/hc/en-gb/articles/360010011480', - 'GB' => 'https://support-pro.packlink.com/hc/en-gb/articles/360010011480', - 'HU' => 'https://support-pro.packlink.com/hc/hu/articles/360010011480', - ); + protected $brandConfigurationService; /** - * List of terms and conditions URLs for different country codes. - * - * @var array + * @var CountryService */ - private static $privacyPolicyUrls = array( - 'EN' => 'https://support-pro.packlink.com/hc/en-gb/articles/360010011560', - 'ES' => 'https://support-pro.packlink.com/hc/es-es/articles/360010011560-Pol%C3%ADtica-de-Privacidad', - 'DE' => 'https://support-pro.packlink.com/hc/de/articles/360010011560-Datenschutzerkl%C3%A4rung-der-Packlink-Shipping-S-L-', - 'FR' => 'https://support-pro.packlink.com/hc/fr-fr/articles/360010011560-Politique-de-confidentialit%C3%A9', - 'IT' => 'https://support-pro.packlink.com/hc/it/articles/360010011560-Politica-di-Privacy', - 'AT' => 'https://support-pro.packlink.com/hc/de/articles/360010011480', - 'NL' => 'https://support-pro.packlink.com/hc/nl/articles/360010011560', - 'BE' => 'https://support-pro.packlink.com/hc/nl/articles/360010011560', - 'PT' => 'https://support-pro.packlink.com/hc/pt/articles/360010011560', - 'TR' => 'https://support-pro.packlink.com/hc/tr/articles/360010011560', - 'IE' => 'https://support-pro.packlink.com/hc/en-gb/articles/360010011560', - 'GB' => 'https://support-pro.packlink.com/hc/en-gb/articles/360010011560', - 'HU' => 'https://support-pro.packlink.com/hc/hu/articles/360010011560', - ); + protected $countryService; /** * Gets the data needed for a registration page. @@ -74,15 +44,19 @@ public function getRegisterData($country) $registrationInfoService = ServiceRegister::getService(RegistrationInfoService::CLASS_NAME); $registrationData = $registrationInfoService->getRegistrationInfoData(); + $brand = $this->getBrandConfigurationService()->get(); + return array( 'context' => $this->getConfigService()->getContext(), 'email' => $registrationData->getEmail(), 'phone' => $registrationData->getPhone(), 'source' => $registrationData->getSource(), - 'termsAndConditionsUrl' => !empty(self::$termsAndConditionsUrls[$country]) ? - self::$termsAndConditionsUrls[$country] : self::$termsAndConditionsUrls[self::DEFAULT_COUNTRY], - 'privacyPolicyUrl' => !empty(self::$privacyPolicyUrls[$country]) ? - self::$privacyPolicyUrls[$country] : self::$privacyPolicyUrls[self::DEFAULT_COUNTRY], + 'termsAndConditionsUrl' => $this->getCountryService() + ->getLabel(strtolower($country), 'register.termsAndConditionsUrl', static::DEFAULT_COUNTRY), + 'privacyPolicyUrl' => $this->getCountryService() + ->getLabel(strtolower($country), 'register.privacyPolicyUrl', static::DEFAULT_COUNTRY), + 'platform_country' => in_array($country, $brand->platformCountries, true) ? + $country : $brand->platformCountries[0], ); } @@ -98,11 +72,14 @@ public function getRegisterData($country) * @throws \Packlink\BusinessLogic\DTO\Exceptions\FrontDtoNotRegisteredException * @throws \Packlink\BusinessLogic\DTO\Exceptions\FrontDtoValidationException * @throws \Packlink\BusinessLogic\Registration\Exceptions\UnableToRegisterAccountException + * @throws \Packlink\BusinessLogic\Brand\Exceptions\PlatformCountryNotSupportedByBrandException */ public function register(array $payload) { - $payload['platform'] = 'PRO'; - $payload['language'] = $this->getLanguage($payload['platform_country']); + $brand = $this->getBrandConfigurationService()->get(); + + $payload['platform'] = $brand->platformCode; + $payload['language'] = $this->getLanguage(); if (isset($payload['source'])) { $payload['source'] = 'https://' . str_replace(array('http://', 'https://'), '', $payload['source']); @@ -153,7 +130,35 @@ protected function getConfigService() } /** - * Returns shop language in format which Packlink expects, based on user's platform country. + * Returns an instance of brand configuration service. + * + * @return BrandConfigurationService + */ + protected function getBrandConfigurationService() + { + if ($this->brandConfigurationService === null) { + $this->brandConfigurationService = ServiceRegister::getService(BrandConfigurationService::CLASS_NAME); + } + + return $this->brandConfigurationService; + } + + /** + * Returns an instance of country service. + * + * @return CountryService + */ + protected function getCountryService() + { + if ($this->countryService === null) { + $this->countryService = ServiceRegister::getService(CountryService::CLASS_NAME); + } + + return $this->countryService; + } + + /** + * Returns shop language in format which Packlink expects. * * @param string $platformCountry * @@ -168,6 +173,7 @@ private function getLanguage($platformCountry) 'IT' => 'it_IT', ); + $locale = Configuration::getUICountryCode(); $language = 'en_GB'; if (array_key_exists($platformCountry, $supportedLanguages)) { diff --git a/src/BusinessLogic/Country/CountryService.php b/src/BusinessLogic/Country/CountryService.php index 1f7166d2..c921c044 100644 --- a/src/BusinessLogic/Country/CountryService.php +++ b/src/BusinessLogic/Country/CountryService.php @@ -4,7 +4,9 @@ use Logeecom\Infrastructure\ServiceRegister; use Packlink\BusinessLogic\BaseService; -use Packlink\BusinessLogic\Configuration; +use Packlink\BusinessLogic\Brand\BrandConfigurationService; +use Packlink\BusinessLogic\DTO\Exceptions\FrontDtoNotRegisteredException; +use Packlink\BusinessLogic\DTO\Exceptions\FrontDtoValidationException; use Packlink\BusinessLogic\DTO\FrontDtoFactory; use Packlink\BusinessLogic\Language\Translator; @@ -26,142 +28,63 @@ class CountryService extends BaseService */ protected static $instance; /** - * List of four default countries. + * BrandConfigurationService instance. * - * @var array + * @var BrandConfigurationService */ - protected static $baseCountries = array('ES', 'DE', 'FR', 'IT'); - /** - * List of supported countries. - * - * @var array - */ - protected static $supportedCountries = array( - 'ES' => array( - 'name' => 'Spain', - 'code' => 'ES', - 'postal_code' => '28001', - 'registration_link' => 'https://auth.packlink.com/es-ES/{integration}/registro', - 'platform_country' => 'ES', - ), - 'DE' => array( - 'name' => 'Germany', - 'code' => 'DE', - 'postal_code' => '10115', - 'registration_link' => 'https://auth.packlink.com/de-DE/{integration}/registrieren', - 'platform_country' => 'DE', - ), - 'FR' => array( - 'name' => 'France', - 'code' => 'FR', - 'postal_code' => '75001', - 'registration_link' => 'https://auth.packlink.com/fr-FR/{integration}/inscription', - 'platform_country' => 'FR', - ), - 'IT' => array( - 'name' => 'Italy', - 'code' => 'IT', - 'postal_code' => '00118', - 'registration_link' => 'https://auth.packlink.com/it-IT/{integration}/registro', - 'platform_country' => 'IT', - ), - 'AT' => array( - 'name' => 'Austria', - 'code' => 'AT', - 'postal_code' => '1010', - 'registration_link' => 'https://auth.packlink.com/de-DE/{integration}/registrieren', - 'platform_country' => 'UN', - ), - 'NL' => array( - 'name' => 'Netherlands', - 'code' => 'NL', - 'postal_code' => '1011', - 'registration_link' => 'https://auth.packlink.com/nl-NL/{integration}/registrieren', - 'platform_country' => 'UN', - ), - 'BE' => array( - 'name' => 'Belgium', - 'code' => 'BE', - 'postal_code' => '1000', - 'registration_link' => 'https://auth.packlink.com/nl-NL/{integration}/registrieren', - 'platform_country' => 'UN', - ), - 'PT' => array( - 'name' => 'Portugal', - 'code' => 'PT', - 'postal_code' => '1000-017', - 'registration_link' => 'https://auth.packlink.com/pt-PT/{integration}/registo', - 'platform_country' => 'UN', - ), - 'TR' => array( - 'name' => 'Turkey', - 'code' => 'TR', - 'postal_code' => '06010', - 'registration_link' => 'https://auth.packlink.com/tr-TR/{integration}/kayıt-yap', - 'platform_country' => 'UN', - ), - 'IE' => array( - 'name' => 'Ireland', - 'code' => 'IE', - 'postal_code' => 'D1', - 'registration_link' => 'https://auth.packlink.com/en-GB/{integration}/register', - 'platform_country' => 'UN', - ), - 'GB' => array( - 'name' => 'United Kingdom', - 'code' => 'GB', - 'postal_code' => 'E1 6AN', - 'registration_link' => 'https://auth.packlink.com/en-GB/{integration}/register?platform_country=UN', - 'platform_country' => 'UN', - ), - 'HU' => array( - 'name' => 'Hungary', - 'code' => 'HU', - 'postal_code' => '1014', - 'registration_link' => 'https://auth.packlink.com/hu-HU/{integration}/regisztracio?platform_country=UN', - 'platform_country' => 'UN', - ), - ); + protected $brandConfigurationService; /** - * Checks if given country is one of the four base countries ('ES', 'DE', 'FR', 'IT'). + * Returns a list of supported country DTOs. * - * @param string $countryCode Country ISO-2 code. + * @param bool $associative Indicates whether the result should be an associative array. + * + * @return Country[] * - * @return bool + * @noinspection PhpUnhandledExceptionInspection + * @noinspection PhpDocMissingThrowsInspection */ - public function isBaseCountry($countryCode) + public function getSupportedCountries($associative = true) { - return in_array(strtoupper($countryCode), static::$baseCountries, true); + $brand = $this->getBrandConfigurationService()->get(); + $countries = $this->formatCountries($brand->registrationCountries); + + return $associative ? $countries : array_values($countries); } /** - * Returns a list of supported country DTOs. + * Formats country DTOs. * - * @param bool $associative Indicates whether the result should be an associative array. + * @param $countries * - * @return RegistrationCountry[] + * @return Country[] * - * @noinspection PhpUnhandledExceptionInspection - * @noinspection PhpDocMissingThrowsInspection + * @throws FrontDtoNotRegisteredException + * @throws FrontDtoValidationException */ - public function getSupportedCountries($associative = true) + protected function formatCountries($countries) { - $countries = array(); - $configuration = ServiceRegister::getService(Configuration::CLASS_NAME); - - foreach (static::$supportedCountries as $country) { - $integration = strtolower($configuration->getIntegrationName()); - $country['registration_link'] = str_replace( - '{integration}', - $integration, - $country['registration_link'] - ) . '?platform=PRO&platform_country=' . $country['platform_country']; + $formattedCountries = array(); + foreach ($countries as $country) { $country['name'] = Translator::translate('countries.' . $country['code']); - $countries[$country['code']] = FrontDtoFactory::get(RegistrationCountry::CLASS_KEY, $country); + $formattedCountries[$country['code']] = FrontDtoFactory::get(Country::CLASS_KEY, $country); } - return $associative ? $countries : array_values($countries); + return $formattedCountries; + } + + /** + * Gets BrandConfigurationService. + * + * @return BrandConfigurationService + */ + protected function getBrandConfigurationService() + { + if ($this->brandConfigurationService === null) { + $this->brandConfigurationService = ServiceRegister::getService(BrandConfigurationService::CLASS_NAME); + } + + return $this->brandConfigurationService; } } diff --git a/src/BusinessLogic/Country/RegistrationCountry.php b/src/BusinessLogic/Country/RegistrationCountry.php deleted file mode 100644 index 8a5495e0..00000000 --- a/src/BusinessLogic/Country/RegistrationCountry.php +++ /dev/null @@ -1,96 +0,0 @@ -registrationLink = static::getDataValue($raw, 'registration_link'); - $instance->platformCountry = static::getDataValue($raw, 'platform_country'); - - return $instance; - } - - /** - * Transforms DTO to its array format. - * - * @return array DTO in array format. - */ - public function toArray() - { - return array_merge( - parent::toArray(), - array( - 'registration_link' => $this->registrationLink, - 'platform_country' => $this->platformCountry, - ) - ); - } -} diff --git a/src/BusinessLogic/Country/WarehouseCountryService.php b/src/BusinessLogic/Country/WarehouseCountryService.php index 6cd1435a..e71f25ec 100644 --- a/src/BusinessLogic/Country/WarehouseCountryService.php +++ b/src/BusinessLogic/Country/WarehouseCountryService.php @@ -22,63 +22,6 @@ class WarehouseCountryService extends CountryService * @var static */ protected static $instance; - /** - * List of countries available only for warehouse selection. - * - * @var array - */ - protected static $additionalWarehouseCountries = array( - 'PL' => array( - 'name' => 'Poland', - 'code' => 'PL', - 'postal_code' => '00-694', - ), - 'CH' => array( - 'name' => 'Switzerland', - 'code' => 'CH', - 'postal_code' => '3000', - ), - 'LU' => array( - 'name' => 'Luxembourg', - 'code' => 'LU', - 'postal_code' => '1009', - ), - 'AR' => array( - 'name' => 'Argentina', - 'code' => 'AR', - 'postal_code' => 'C1258 AAA', - ), - 'US' => array( - 'name' => 'United States', - 'code' => 'US', - 'postal_code' => '01223', - ), - 'BO' => array( - 'name' => 'Bolivia', - 'code' => 'BO', - 'postal_code' => 'La Paz', - ), - 'MX' => array( - 'name' => 'Mexico', - 'code' => 'MX', - 'postal_code' => '21900', - ), - 'CL' => array( - 'name' => 'Chile', - 'code' => 'CL', - 'postal_code' => '7500599', - ), - 'CZ' => array( - 'name' => 'Czech Republic', - 'code' => 'CZ', - 'postal_code' => '186 00', - ), - 'SE' => array( - 'name' => 'Sweden', - 'code' => 'SE', - 'postal_code' => '103 16', - ), - ); /** * Returns a list of supported country DTOs. @@ -92,14 +35,10 @@ class WarehouseCountryService extends CountryService */ public function getSupportedCountries($associative = true) { - $countries = array_merge(static::$supportedCountries, static::$additionalWarehouseCountries); + $countries = $this->getBrandConfigurationService()->get()->warehouseCountries; + $formattedCountries = $this->formatCountries($countries); - foreach ($countries as $country) { - $country['name'] = Translator::translate('countries.' . $country['code']); - $countries[$country['code']] = FrontDtoFactory::get(Country::CLASS_KEY, $country); - } - - return $associative ? $countries : array_values($countries); + return $associative ? $formattedCountries : array_values($formattedCountries); } /** @@ -111,6 +50,8 @@ public function getSupportedCountries($associative = true) */ public function isCountrySupported($isoCode) { - return array_key_exists($isoCode, array_merge(static::$supportedCountries, static::$additionalWarehouseCountries)); + $countries = $this->getBrandConfigurationService()->get()->warehouseCountries; + + return array_key_exists($isoCode, $countries); } } diff --git a/src/BusinessLogic/CountryLabels/CountryService.php b/src/BusinessLogic/CountryLabels/CountryService.php new file mode 100644 index 00000000..d72f2116 --- /dev/null +++ b/src/BusinessLogic/CountryLabels/CountryService.php @@ -0,0 +1,187 @@ + ['labelKey' => 'label']] + * @var array + */ + protected static $labels = array(); + + /** + * @var FileResolverService + */ + protected $fileResolverService; + + /** + * @var string + */ + private $currentLanguage; + + /** + * CountryService constructor. + * + * @param FileResolverService $fileResolverService + */ + public function __construct(FileResolverService $fileResolverService) + { + $this->fileResolverService = $fileResolverService; + } + + /** + * Gets label for a key in current language. + * If the key can not be found for the current language, label fallback + * value will be returned (label in English). + * If the key is not found in fallback passed key will be returned. + * + * @param string $key

Key of a wanted label. If the key is nested it should be sent separated by '.'. + * For example: + * File that contains labels has next definition: {"parent": {"child": "childLabel"}}. + * The key for a parent is: "parent", the key for a child is: "parent.child"

+ * @param array $arguments A list of arguments. + * + * @return string Label if label is found; otherwise, the input key. + */ + public function getText($key, array $arguments = array()) + { + $this->currentLanguage = Configuration::getUICountryCode() ?: static::DEFAULT_LANG; + + $result = $this->fetchLabel($key, static::DEFAULT_LANG); + + return vsprintf($result, $arguments); + } + + /** + * @inheritDoc + */ + public function getLabel($countryCode, $key, $fallbackCode = self::DEFAULT_LANG) + { + $languageBackup = $this->currentLanguage; + $this->currentLanguage = $countryCode; + + $label = $this->fetchLabel($key, $fallbackCode); + + $this->currentLanguage = $languageBackup; + + return $label; + } + + /** + * @inheritDoc + */ + public function getAllLabels($countryCode) + { + $labels[$countryCode] = $this->fileResolverService->getContent($countryCode); + $labels[static::DEFAULT_LANG] = $this->fileResolverService->getContent(static::DEFAULT_LANG); + + return $labels; + } + + /** + * @param $key + * @param $defaultLanguage + * + * @return string|null + */ + protected function fetchLabel($key, $defaultLanguage) + { + $result = $this->getLabelByCurrentLanguage($key); + + if ($result === null) { + $this->initializeLanguage($defaultLanguage); + $result = $this->getLabelByKeyAndLanguage($key, $defaultLanguage); + } + + if ($result === null) { + $result = $key; + } + + return $result; + } + + /** + * Initializes the labels from a file to in-memory map. + */ + protected function initializeLabels() + { + $languageLowerCase = strtolower($this->currentLanguage); + $this->initializeLanguage($languageLowerCase); + $this->initializeFallbackLanguage(); + } + + /** + * Initializes the language to labels dictionary. + * + * @param $language + */ + protected function initializeLanguage($language) + { + $labels = $this->fileResolverService->getContent($language); + + foreach ($labels as $groupKey => $group) { + if (is_array($group)) { + foreach ($group as $key => $value) { + static::$labels[$language][$groupKey . '.' . $key] = $value; + } + } else { + static::$labels[$language][$groupKey] = $group; + } + } + } + + /** + * Initializes the fallback language. + */ + protected function initializeFallbackLanguage() + { + if (strtolower($this->currentLanguage) !== static::DEFAULT_LANG) { + $this->initializeLanguage(static::DEFAULT_LANG); + } + } + + /** + * Gets the label for given key and language. + * + * @param string $key The label key. + * @param string $language The language. + * + * @return string|null The label. + */ + protected function getLabelByKeyAndLanguage($key, $language) + { + return isset(static::$labels[$language][$key]) ? static::$labels[$language][$key] : null; + } + + /** + * Gets label by current language. + * + * @param string $key The label key. + * + * @return string|null The label. + */ + protected function getLabelByCurrentLanguage($key) + { + if (empty(static::$labels[$this->currentLanguage])) { + $this->initializeLabels(); + } + + return $this->getLabelByKeyAndLanguage($key, $this->currentLanguage); + } +} diff --git a/src/BusinessLogic/CountryLabels/Interfaces/CountryService.php b/src/BusinessLogic/CountryLabels/Interfaces/CountryService.php new file mode 100644 index 00000000..f92ab0ad --- /dev/null +++ b/src/BusinessLogic/CountryLabels/Interfaces/CountryService.php @@ -0,0 +1,53 @@ +Key of a wanted label. If the key is nested it should be sent separated by '.'. + * For example: + * File that contains labels has next definition: {"parent": {"child": "childLabel"}}. + * The key for a parent is: "parent", the key for a child is: "parent.child"

+ * @param array $arguments A list of arguments. + * + * @return string Label if label is found; otherwise, the input key. + */ + public function getText($key, array $arguments = array()); + + /** + * Fetches labels for a specific country (provided by $countryCode parameter) + * and default country. + * + * @param string $countryCode + * @param string $key + * @param string $fallbackCode + * + * @return string + */ + public function getLabel($countryCode, $key, $fallbackCode = ''); + + /** + * Gets all labels for provided country code and default code. + * + * @param string $countryCode + * + * @return array + */ + public function getAllLabels($countryCode); +} diff --git a/src/BusinessLogic/FileResolver/FileResolverService.php b/src/BusinessLogic/FileResolver/FileResolverService.php new file mode 100644 index 00000000..06721dda --- /dev/null +++ b/src/BusinessLogic/FileResolver/FileResolverService.php @@ -0,0 +1,81 @@ +folders = $folders; + } + + /** + * Returns merged content of the requested source file. + * + * @param string $sourceFile + * + * @return array + */ + public function getContent($sourceFile) + { + $content = array(); + + foreach ($this->folders as $folder) { + $filePath = $folder . '/' . $sourceFile . '.json'; + + if (!file_exists($filePath)) { + continue; + } + + $serializedJson = file_get_contents($filePath); + + if ($serializedJson) { + $content[] = json_decode($serializedJson, true); + } + } + + return $content === array() ? $content : call_user_func_array('array_replace_recursive', $content); + } + + /** + * Adds new folder to the folders array. + * + * @param string $folder + */ + public function addFolder($folder) + { + $this->folders[] = $folder; + } + + /** + * Gets folders array. + * + * @return array + */ + public function getFolders() + { + return $this->folders; + } +} diff --git a/src/BusinessLogic/Http/DTO/Draft.php b/src/BusinessLogic/Http/DTO/Draft.php index c2593af7..30988f96 100644 --- a/src/BusinessLogic/Http/DTO/Draft.php +++ b/src/BusinessLogic/Http/DTO/Draft.php @@ -3,6 +3,8 @@ namespace Packlink\BusinessLogic\Http\DTO; use Logeecom\Infrastructure\Data\DataTransferObject; +use Logeecom\Infrastructure\ServiceRegister; +use Packlink\BusinessLogic\Brand\BrandConfigurationService; use Packlink\BusinessLogic\Http\DTO\Draft\AdditionalData; use Packlink\BusinessLogic\Http\DTO\Draft\Address; use Packlink\BusinessLogic\Http\DTO\Draft\DraftPrice; @@ -31,7 +33,7 @@ class Draft extends DataTransferObject * * @var string */ - public $platform = 'PRO'; + public $platform; /** * Unique platform country identifier. * @@ -148,6 +150,17 @@ class Draft extends DataTransferObject */ public $price; + /** + * Draft constructor. + */ + public function __construct() + { + /** @var BrandConfigurationService $service */ + $service = ServiceRegister::getService(BrandConfigurationService::CLASS_NAME); + + $this->platform = $service->get()->platformCode; + } + /** * Transforms DTO to its array format suitable for http client. * diff --git a/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php b/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php index af9fc645..a3fd16f4 100644 --- a/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php +++ b/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php @@ -3,6 +3,8 @@ namespace Packlink\BusinessLogic\Http\DTO; use Logeecom\Infrastructure\Data\DataTransferObject; +use Logeecom\Infrastructure\ServiceRegister; +use Packlink\BusinessLogic\Brand\BrandConfigurationService; /** * This class holds search parameters that are used when searching for services @@ -82,12 +84,16 @@ public function __construct( */ public function toArray() { + /** @var BrandConfigurationService $brandConfigurationService */ + $brandConfigurationService = ServiceRegister::getService(BrandConfigurationService::CLASS_NAME); + $brand = $brandConfigurationService->get(); + $data = array( 'from[country]' => $this->fromCountry, 'from[zip]' => $this->fromZip, 'to[country]' => $this->toCountry, 'to[zip]' => $this->toZip, - 'source' => 'PRO', + 'source' => $brand->shippingServiceSource, ); if ($this->serviceId) { diff --git a/src/BusinessLogic/Http/Proxy.php b/src/BusinessLogic/Http/Proxy.php index c59904a5..77188b6c 100644 --- a/src/BusinessLogic/Http/Proxy.php +++ b/src/BusinessLogic/Http/Proxy.php @@ -8,6 +8,8 @@ use Logeecom\Infrastructure\Http\HttpClient; use Logeecom\Infrastructure\Http\HttpResponse; use Logeecom\Infrastructure\Logger\Logger; +use Logeecom\Infrastructure\ServiceRegister; +use Packlink\BusinessLogic\Brand\BrandConfigurationService; use Packlink\BusinessLogic\Configuration; use Packlink\BusinessLogic\DTO\FrontDtoFactory; use Packlink\BusinessLogic\Http\DTO\Analytics; @@ -199,9 +201,11 @@ public function getLocations($serviceId, $countryCode, $postalCode) */ public function searchLocations($platformCountry, $postalZone, $query) { + $brand = $this->getBrandConfigurationService()->get(); + $url = 'locations/postalcodes?' . http_build_query( array( - 'platform' => 'PRO', + 'platform' => $brand->platformCode, 'platform_country' => $platformCountry, 'postalzone' => $postalZone, 'q' => $query, @@ -245,9 +249,11 @@ public function getPostalCodes($countryCode, $zipCode) */ public function getPostalZones($countryCode, $lang = 'en') { + $brand = $this->getBrandConfigurationService()->get(); + $url = 'locations/postalzones/destinations?' . http_build_query( array( - 'platform' => 'PRO', + 'platform' => $brand->platformCode, 'platform_country' => $countryCode, 'language' => $lang, ) @@ -552,4 +558,13 @@ private function getRequestHeaders() 'Ecommerce-Version' => 'X-Ecommerce-Version: ' . $this->configService->getECommerceVersion(), ); } + + /** + * @return BrandConfigurationService + */ + private function getBrandConfigurationService() + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return ServiceRegister::getService(BrandConfigurationService::CLASS_NAME); + } } diff --git a/src/BusinessLogic/Language/Interfaces/TranslationService.php b/src/BusinessLogic/Language/Interfaces/TranslationService.php deleted file mode 100644 index 8dcae2ab..00000000 --- a/src/BusinessLogic/Language/Interfaces/TranslationService.php +++ /dev/null @@ -1,32 +0,0 @@ -String to be translated. If the key is nested it should be sent separated by '.'. - * For example: - * Translation file has next definition: {"parent": {"child": "childTranslation"}}. - * The key for a parent is: "parent", the key for a child is: "parent.child"

- * @param array $arguments A list of arguments for translation if needed. - * - * @return string A translated string if translation is found; otherwise, the input key. - */ - public function translate($key, array $arguments = array()); -} diff --git a/src/BusinessLogic/Language/TranslationService.php b/src/BusinessLogic/Language/TranslationService.php deleted file mode 100644 index a78efbf4..00000000 --- a/src/BusinessLogic/Language/TranslationService.php +++ /dev/null @@ -1,153 +0,0 @@ - ['translationKey' => 'translation']] - * @var array - */ - protected static $translations = array(); - - /** - * @var string $translationsFileBasePath - */ - protected $translationsFileBasePath; - - /** - * @var string - */ - private $currentLanguage; - - /** - * TranslationService constructor. - * - * @param string|null $translationsFileBasePath - */ - public function __construct($translationsFileBasePath = null) - { - $this->translationsFileBasePath = $translationsFileBasePath; - - if (empty($this->translationsFileBasePath)) { - $this->translationsFileBasePath = __DIR__ . '/../Resources/lang'; - } - } - - /** - * Translates a key to a value defined for that key for a current language. - * If the key can not be found for the current language, translation fallback - * value will be returned (translation in English). - * If the key is not found in fallback passed key will be returned. - * - * @param string $key

String to be translated. If the key is nested it should be sent separated by '.'. - * For example: - * Translation file has next definition: {"parent": {"child": "childTranslation"}}. - * The key for a parent is: "parent", the key for a child is: "parent.child"

- * @param array $arguments A list of arguments for translation if needed. - * - * @return string A translated string if translation is found; otherwise, the input key. - */ - public function translate($key, array $arguments = array()) - { - $this->currentLanguage = Configuration::getCurrentLanguage() ?: static::DEFAULT_LANG; - - if (empty(static::$translations[$this->currentLanguage])) { - $this->initializeTranslations(); - } - - $result = $this->getTranslation($key, $this->currentLanguage); - - if ($result === null) { - $result = $this->getTranslation($key, static::DEFAULT_LANG); - } - - if ($result === null) { - $result = $key; - } - - return vsprintf($result, $arguments); - } - - /** - * Initializes the translations from a file to in-memory map. - */ - protected function initializeTranslations() - { - $languageLowerCase = strtolower($this->currentLanguage); - $this->translationsFileBasePath = rtrim($this->translationsFileBasePath, '/') . '/'; - $translationFilePath = "{$this->translationsFileBasePath}{$languageLowerCase}.json"; - $this->initializeLanguage($translationFilePath, $this->currentLanguage); - $this->initializeFallbackLanguage(); - } - - /** - * Initializes the language to translations dictionary. - * - * @param $translationFilePath - * @param $language - */ - protected function initializeLanguage($translationFilePath, $language) - { - try { - $serializedJson = file_get_contents($translationFilePath); - } catch (Exception $ex) { - $serializedJson = false; - Logger::logWarning($ex->getMessage()); - } - - if ($serializedJson !== false) { - $translations = json_decode($serializedJson, true); - foreach ($translations as $groupKey => $group) { - if (is_array($group)) { - foreach ($group as $key => $value) { - static::$translations[$language][$groupKey . '.' . $key] = $value; - } - } else { - static::$translations[$language][$groupKey] = $group; - } - } - } - } - - /** - * Initializes the fallback language. - */ - protected function initializeFallbackLanguage() - { - if (strtolower($this->currentLanguage) !== static::DEFAULT_LANG) { - $defaultLang = static::DEFAULT_LANG; - $translationFilePath = "{$this->translationsFileBasePath}{$defaultLang}.json"; - $this->initializeLanguage($translationFilePath, static::DEFAULT_LANG); - } - } - - /** - * Gets the translation for given key and language. - * - * @param string $key The translation key. - * @param string $language The translation language. - * - * @return string|null The translation. - */ - protected function getTranslation($key, $language) - { - return isset(static::$translations[$language][$key]) ? static::$translations[$language][$key] : null; - } -} diff --git a/src/BusinessLogic/Language/Translator.php b/src/BusinessLogic/Language/Translator.php index 152add01..356c3231 100644 --- a/src/BusinessLogic/Language/Translator.php +++ b/src/BusinessLogic/Language/Translator.php @@ -3,7 +3,7 @@ namespace Packlink\BusinessLogic\Language; use Logeecom\Infrastructure\ServiceRegister; -use Packlink\BusinessLogic\Language\Interfaces\TranslationService as TranslationServiceInterface; +use Packlink\BusinessLogic\CountryLabels\Interfaces\CountryService as LabelServiceInterface; /** * Class Translator. @@ -13,9 +13,9 @@ class Translator { /** - * @var TranslationServiceInterface + * @var LabelServiceInterface */ - protected static $translationService; + protected static $countryService; /** * Translates provided string. @@ -27,20 +27,20 @@ class Translator */ public static function translate($key, array $arguments = array()) { - return static::getTranslationService()->translate($key, $arguments); + return static::getCountryService()->getText($key, $arguments); } /** * Retrieves translation service. * - * @return TranslationServiceInterface + * @return LabelServiceInterface */ - protected static function getTranslationService() + protected static function getCountryService() { - if (static::$translationService === null) { - static::$translationService = ServiceRegister::getService(TranslationServiceInterface::CLASS_NAME); + if (static::$countryService === null) { + static::$countryService = ServiceRegister::getService(LabelServiceInterface::CLASS_NAME); } - return static::$translationService; + return static::$countryService; } } diff --git a/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php b/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php index 2f6fe1ac..52b2dacf 100644 --- a/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php +++ b/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php @@ -5,8 +5,8 @@ use Logeecom\Infrastructure\Configuration\Configuration; use Logeecom\Infrastructure\ServiceRegister; use Packlink\BusinessLogic\BaseService; -use Packlink\BusinessLogic\Country\CountryService; use Packlink\BusinessLogic\Http\DTO\ShipmentLabel; +use Packlink\BusinessLogic\CountryLabels\Interfaces\CountryService; use Packlink\BusinessLogic\OrderShipmentDetails\Exceptions\OrderShipmentDetailsNotFound; use Packlink\BusinessLogic\OrderShipmentDetails\Models\OrderShipmentDetails; use Packlink\BusinessLogic\ShippingMethod\Utility\ShipmentStatus; @@ -272,15 +272,15 @@ protected function getDraftShipmentUrl($reference) /** @var \Packlink\BusinessLogic\Configuration $configService */ $configService = ServiceRegister::getService(Configuration::CLASS_NAME); $userInfo = $configService->getUserInfo(); + $countryCode = 'en'; + + if ($userInfo) { + $countryCode = $userInfo->country; + } /** @var CountryService $countryService */ $countryService = ServiceRegister::getService(CountryService::CLASS_NAME); - $userDomain = 'com'; - if ($userInfo !== null && $countryService->isBaseCountry($userInfo->country)) { - $userDomain = strtolower($userInfo->country); - } - - return "https://pro.packlink.$userDomain/private/shipments/$reference"; + return $countryService->getLabel(strtolower($countryCode), 'orderListAndDetails.shipmentUrl') . $reference; } } diff --git a/src/BusinessLogic/Registration/RegistrationRequest.php b/src/BusinessLogic/Registration/RegistrationRequest.php index 779ace9f..9805e1cd 100644 --- a/src/BusinessLogic/Registration/RegistrationRequest.php +++ b/src/BusinessLogic/Registration/RegistrationRequest.php @@ -2,6 +2,8 @@ namespace Packlink\BusinessLogic\Registration; +use Logeecom\Infrastructure\ServiceRegister; +use Packlink\BusinessLogic\Brand\BrandConfigurationService; use Packlink\BusinessLogic\DTO\FrontDto; use Packlink\BusinessLogic\DTO\ValidationError; use Packlink\BusinessLogic\Language\Translator; @@ -54,7 +56,7 @@ class RegistrationRequest extends FrontDto */ public $language; /** - * Platform (only supported platform is "PRO"). + * Platform. * * @var string */ @@ -209,6 +211,8 @@ protected static function doValidate(array $payload, array &$validationErrors) { parent::doValidate($payload, $validationErrors); + $brand = static::getBrandConfigurationService()->get(); + if (!empty($payload['email']) && !DtoValidator::isEmailValid($payload['email'])) { static::setInvalidFieldError('email', $validationErrors, Translator::translate('validation.invalidEmail')); } @@ -244,7 +248,7 @@ protected static function doValidate(array $payload, array &$validationErrors) } if (!empty($payload['platform_country']) - && !in_array($payload['platform_country'], static::$supportedPlatformCountries, true) + && !in_array($payload['platform_country'], $brand->platformCountries, true) ) { static::setInvalidFieldError( 'platform_country', @@ -257,12 +261,21 @@ protected static function doValidate(array $payload, array &$validationErrors) static::setInvalidFieldError('source', $validationErrors, Translator::translate('validation.invalidUrl')); } - if (!empty($payload['platform']) && $payload['platform'] !== 'PRO') { + if (!empty($payload['platform']) && $payload['platform'] !== $brand->platformCode) { static::setInvalidFieldError( 'platform', $validationErrors, - Translator::translate('validation.invalidFieldValue', array('PRO')) + Translator::translate('validation.invalidFieldValue', array($brand->platformCode)) ); } } + + /** + * @return BrandConfigurationService + */ + private static function getBrandConfigurationService() + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return ServiceRegister::getService(BrandConfigurationService::CLASS_NAME); + } } diff --git a/src/BusinessLogic/Resources/lang/de.json b/src/BusinessLogic/Resources/countries/de.json similarity index 85% rename from src/BusinessLogic/Resources/lang/de.json rename to src/BusinessLogic/Resources/countries/de.json index c63762cb..0a06c9b7 100644 --- a/src/BusinessLogic/Resources/lang/de.json +++ b/src/BusinessLogic/Resources/countries/de.json @@ -1,10 +1,5 @@ { "general": { - "packlinkPro": "Packlink PRO Shipping", - "saveUp": "Sparen Sie bis zu 70% bei Ihren Versandkosten. Keine festen Gebühren, kein Mindestvolumen beim Versand. Verwalten Sie alle Ihre Sendungen auf einer einzigen Plattform.", - "packlinkShipping": "Packlink Shipping S.L.", - "noContract": "Ohne Vertragsbindung – Sofortiger Zugriff auf über 300 Versanddienste in einer einzigen Plattform. Verbinden Sie Ihren Onlineshop und steuern Sie alle Sendungen über Packlink PRO.", - "developedAndManaged": "Entwickelt und verwaltet von Packlink", "generalConditions": "Allgemeine Bedingungen", "basicSettings": "Einstellungen", "contactUs": "Kontaktieren Sie uns", @@ -48,8 +43,6 @@ "apiKey": "API-Schlüssel", "apiKeyIncorrect": "Falscher API-Schlüssel", "dontHaveAccount": "Sie haben noch keinen Account?", - "welcome": "Willkommen zu Packlink PRO", - "connectYourService": "Verbinden Sie Ihren Dienst, indem Sie Ihren API-Schlüssel verwenden. Sie finden ihn unter
„Packlink Pro API-Schlüssel“ bei den „Einstellungen“.", "validateApiKey": "API-Schlüssel bestätigen", "chooseYourCountry": "Wählen Sie Ihr Land aus, um mit der Registrierung beginnen zu können", "registerMe": "Registrieren" @@ -83,13 +76,10 @@ "email": "E-Mail", "password": "Passwort", "haveAccount": "Haben Sie bereits einen Account?", - "startEnjoying": "Genießen Sie ab jetzt Packlink PRO!", "registerAccount": "Jetzt registrieren", "getToKnowYou": "Wir möchten Sie besser kennenlernen, um uns an Sie anzupassen und Ihnen ein individuelles Angebot zukommen zu lassen", "monthlyShipmentVolume": "Wie hoch ist Ihr monatliches Sendungsaufkommen?", "phone": "Telefonnummer", - "termsAndConditions": "
Ich akzeptiere die Nutzungsbedingungen und die Datenschutzerklärung von Packlink
", - "marketingEmails": "Ich ermächtige Packlink Shipping S.L., mir kommerzielle Mitteilungen per E-Mail zuzusenden", "submit": "Registrieren", "chooseYourCountry": "Wählen Sie Ihr Land aus", "searchCountry": "Land suchen", @@ -160,8 +150,6 @@ }, "orderStatusMapping": { "title": "Bestellstatus", - "description": "Mit Packlink können Sie Ihren %s Bestellstatus mit Versandinformationen aktualisieren.
Sie können die Informationen jederzeit bearbeiten.", - "packlinkProShipmentStatus": "VERSANDSTATUS von Packlink PRO", "systemOrderStatus": "BESTELLSTATUS von %s", "none": "Leer", "pending": "Ausstehend", @@ -211,11 +199,9 @@ "origin": "Absender", "destination": "Empfänger", "myPrices": "Meine Preise", - "packlinkPrices": "Packlink-Preise", "configureService": "Dienst einrichten", "showCarrierLogo": "Meinen Kunden das Logo anzeigen", "pricePolicy": "Preispolitik", - "pricePolicyDescription": "Standardmäßig werden die Packlink Basispreise eingestellt sein. Sie können diese jedoch weiter unten genauer konfigurieren.", "configurePricePolicy": "Meine Versandkosten einrichten", "taxClassTitle": "Wählen Sie Ihre gespeicherte Steuerkategorie", "tax": "Steuer", @@ -241,9 +227,6 @@ "weightAndPriceRangeWithData": "Gewichts- und Preisklasse: von %s kg bis %s kg und von %s € bis %s €", "singlePricePolicy": "Preispolitik %s", "pricePolicyExplanation": "2. Wählen Sie eine Preispolitik und richten Sie diese ein.", - "packlinkPrice": "Packlink-Preise", - "percentagePacklinkPrices": "% der Packlink-Preise", - "percentagePacklinkPricesWithData": "% der Packlink-Preise: %s von %s%", "fixedPrices": "Festpreis", "fixedPricesWithData": "Festpreis: %s €", "increaseExplanation": "Erhöhen: fügen Sie % zum Preis hinzu. Dies wird dann vom Kunden bezahlt.", @@ -255,17 +238,14 @@ "selectAllCountries": "Alle ausgewählten Länder", "selectCountriesHeader": "Länder, die von Ihrem
Versanddienst unterstützt werden", "selectCountriesSubheader": "Wählen Sie die Verfügbarkeit von mindestens einem Land aus und fügen Sie
beliebig viele hinzu", - "usePacklinkRange": "Für alle anderen Bereiche gelten die Packlink-Preise", "discardChangesQuestion": "Es gibt nicht gespeicherte Änderungen.
Sind Sie sicher, dass Sie zurückgehen und sie verwerfen möchten?", "atLeastOneCountry": "" }, "orderListAndDetails": { - "packlinkOrderDraft": "Packlink Auftragsentwurf", "printed": "Ausgedruckt", "ready": "Bereit", "printLabel": "Versandetikett drucken", "shipmentLabels": "Versandetiketten", - "printShipmentLabels": "Packlink PRO Versandetiketten drucken", "shipmentDetails": "Versanddetails", "disablePopUpBlocker": "Bitte deaktivieren Sie den Popup-Blocker auf dieser Seite, um alle Versandetiketten auf einmal zu öffnen.", "date": "Datum", @@ -274,21 +254,14 @@ "print": "Drucken", "carrierTrackingNumbers": "Trackingnummer des Versandunternehmens", "trackIt": "Versand verfolgen", - "packlinkReferenceNumber": "Packlink Referenznummer", - "packlinkShippingPrice": "Packlink Versandpreis", - "viewOnPacklink": "Auf Packlink PRO ansehen", "createDraft": "Entwurf erstellen", - "draftIsBeingCreated": "Der Entwurf wird gerade in Packlink PRO erstellt", - "createOrderDraft": "Entwurf der Bestellung in Packlink PRO erstellen", "draftCreateFailed": "Der Versuch der Entwurfserstellung ist fehlgeschlagen. Fehler: %s", - "packlinkShipping": "Packlink Shipping", "shipmentOrderNotExist": "Die Bestellung mit der Versandreferenznummer %s existiert nicht im Shop", "orderDetailsNotFound": "Bestelldetails nicht gefunden", "orderNotExist": "Die Bestellung mit der ID %s existiert nicht im Shop", "bulkFailCreateFail": "Die Datei der Versandetiketten konnte nicht erstellt werden", "draftOrderDelayed": "Die Erstellung des Entwurfs verzögert sich", - "completeServicesSetup": "You need to complete the services setup to create order draft.", - "sendWithPacklink": "Send with Packlink" + "completeServicesSetup": "You need to complete the services setup to create order draft." }, "checkoutProcess": { "choseDropOffLocation": "Dieser Versanddienst unterstützt die Zustellung an vordefinierte Abgabestellen. Bitte wählen Sie den für Sie günstigsten Ort aus, indem Sie auf \"Abgabestelle auswählen\" klicken.", @@ -331,7 +304,6 @@ }, "systemLogMessages": { "errorCreatingDefaultTask": "Fehler beim Erstellen der Standardkonfiguration des Task-Runner-Status.", - "webhookReceived": "Webhook von Packlink erhalten", "couldNotDelete": "Element %s mit ID %s konnte nicht gelöscht werden", "entityCannotBeSaved": "Element %s mit ID %s kann nicht gespeichert werden.", "entityCannotBeUpdated": "Element %s mit ID %s kann nicht aktualisiert werden.", @@ -344,11 +316,8 @@ "autoTest": { "dbNotAccessible.": "Zugriff auf Datenbank nicht möglich.", "taskCouldNotBeStarted.": "Die Aufgabe konnte nicht gestartet werden.", - "moduleAutoTest": "Automatischer Test PacklinkPRO-Modul", - "useThisPageTestConfiguration": "Auf dieser Seite können Sie die Systemkonfiguration und die Dienste des PacklinkPRO-Moduls testen.", "start": "Start", "downloadTestLog": "Testprotokoll herunterladen", - "openModule": "PacklinkPRO-Modul öffnen", "autotestPassedSuccessfully": "Der automatische Test wurde erfolgreich abgeschlossen!", "testNotSuccessful": "Der Test wurde nicht erfolgreich abgeschlossen!" } diff --git a/src/BusinessLogic/Resources/lang/en.json b/src/BusinessLogic/Resources/countries/en.json similarity index 85% rename from src/BusinessLogic/Resources/lang/en.json rename to src/BusinessLogic/Resources/countries/en.json index 5cc5d3bb..577bb12e 100644 --- a/src/BusinessLogic/Resources/lang/en.json +++ b/src/BusinessLogic/Resources/countries/en.json @@ -1,10 +1,5 @@ { "general": { - "packlinkPro": "Packlink PRO Shipping", - "saveUp": "Save up to 70% on your shipping costs. No fixed fees, no minimum shipping volume required. Manage all your shipments in a single platform.", - "packlinkShipping": "Packlink Shipping S.L.", - "noContract": "No contract needed! More than 300 transport services into a single platform. You can connect all your ecommerce and manage all your shipments in Packlink PRO.", - "developedAndManaged": "Developed and managed by Packlink", "generalConditions": "General conditions", "basicSettings": "Basic settings", "contactUs": "Contact us", @@ -48,8 +43,6 @@ "apiKey": "Api key", "apiKeyIncorrect": "API key was incorrect.", "dontHaveAccount": "Don't have an account?", - "welcome": "Welcome to Packlink PRO", - "connectYourService": "Connect your service using your key. You'll find it in the
\"Packlink Pro API Key\" section of the \"Settings\".", "validateApiKey": "Validate API key", "chooseYourCountry": "Choose your country to start the registration process", "registerMe": "Register me" @@ -83,13 +76,10 @@ "email": "Email", "password": "Password", "haveAccount": "Already have an account?", - "startEnjoying": "Start enjoying Packlink PRO!", "registerAccount": "Register your account", "getToKnowYou": "We would like to get to know you better in order to adapt to you and to send you an individual offer", "monthlyShipmentVolume": "What is your monthly shipment volume?", "phone": "Phone number", - "termsAndConditions": "
I accept the Terms of Service and the Privacy Policy of Packlink
", - "marketingEmails": "I authorise Packlink Shipping S.L. to send me commercial communications by e-mail", "submit": "Register", "chooseYourCountry": "Choose your country", "searchCountry": "Search country", @@ -160,8 +150,6 @@ }, "orderStatusMapping": { "title": "Order status", - "description": "With Packlink you can update your %s order status with shipping information.
You can edit it at any time.", - "packlinkProShipmentStatus": "Packlink PRO SHIPMENT STATUS", "systemOrderStatus": "%s ORDER STATUS", "none": "None", "pending": "Pending", @@ -211,11 +199,9 @@ "origin": "Origin", "destination": "Destination", "myPrices": "My prices", - "packlinkPrices": "Packlink prices", "configureService": "Set up service", "showCarrierLogo": "Show carrier logo to my customers", "pricePolicy": "Price policy", - "pricePolicyDescription": "The default will be Packlink's basic prices. But you can configure these in a more precise way below.", "configurePricePolicy": "Set up my shipment prices", "taxClassTitle": "Choose your saved tax class", "tax": "Tax", @@ -241,9 +227,6 @@ "weightAndPriceRangeWithData": "Weight and price range: from %s kg to %s kg and from %s€ to %s€", "singlePricePolicy": "Price policy %s", "pricePolicyExplanation": "2. Choose a price policy and set it up.", - "packlinkPrice": "Packlink Price", - "percentagePacklinkPrices": "% of Packlink prices", - "percentagePacklinkPricesWithData": "% of Packlink prices: %s by %s%", "fixedPrices": "Fixed price", "fixedPricesWithData": "Fixed price: %s€", "increaseExplanation": "Increase: add a % to the price, this will be paid by the customer.", @@ -255,17 +238,14 @@ "selectAllCountries": "All selected countries", "selectCountriesHeader": "Countries supported for your
shipping service", "selectCountriesSubheader": "Select availability of at least one country and add
as many required", - "usePacklinkRange": "For all other ranges, apply Packlink prices", "discardChangesQuestion": "There are unsaved changes.
Are you sure you want to go back and discard them?", "atLeastOneCountry": "At least one country must be selected." }, "orderListAndDetails": { - "packlinkOrderDraft": "Packlink order draft", "printed": "Printed", "ready": "Ready", "printLabel": "Print label", "shipmentLabels": "Shipment Labels", - "printShipmentLabels": "Print Packlink PRO Shipment Labels", "shipmentDetails": "Shipment details", "disablePopUpBlocker": "Please disable pop-up blocker on this page in order to bulk open shipment labels", "date": "Date", @@ -274,21 +254,14 @@ "print": "Print", "carrierTrackingNumbers": "Carrier tracking numbers", "trackIt": "Track it!", - "packlinkReferenceNumber": "Packlink reference number", - "packlinkShippingPrice": "Packlink shipping price", - "viewOnPacklink": "View on Packlink PRO", "createDraft": "Create Draft", - "draftIsBeingCreated": "Draft is currently being created in Packlink PRO", - "createOrderDraft": "Create order draft in Packlink PRO", "draftCreateFailed": "Previous attempt to create a draft failed. Error: %s", - "packlinkShipping": "Packlink Shipping", "shipmentOrderNotExist": "Order with shipment reference %s doesn't exist in the shop", "orderDetailsNotFound": "Order details not found", "orderNotExist": "Order with ID %s doesn't exist in the shop", "bulkFailCreateFail": "Unable to create bulk labels file", "draftOrderDelayed": "Creation of the draft is delayed", - "completeServicesSetup": "You need to complete the services setup to create order draft.", - "sendWithPacklink": "Send with Packlink" + "completeServicesSetup": "You need to complete the services setup to create order draft." }, "checkoutProcess": { "choseDropOffLocation": "This shipping service supports delivery to pre-defined drop-off locations. Please choose location that suits you the most by clicking on the \"Select drop-off location\" button.", @@ -331,7 +304,6 @@ }, "systemLogMessages": { "errorCreatingDefaultTask": "Error creating default task runner status configuration.", - "webhookReceived": "Webhook from Packlink received.", "couldNotDelete": "Could not delete entity %s with ID %s", "entityCannotBeSaved": "Entity %s with ID %s cannot be saved.", "entityCannotBeUpdated": "Entity %s with ID %s cannot be updated.", @@ -344,11 +316,8 @@ "autoTest": { "dbNotAccessible.": "Database not accessible.", "taskCouldNotBeStarted.": "Task could not be started.", - "moduleAutoTest": "PacklinkPRO module auto-test", - "useThisPageTestConfiguration": "Use this page to test the system configuration and PacklinkPRO module services.", "start": "Start", "downloadTestLog": "Download test log", - "openModule": "Open PacklinkPRO module", "autotestPassedSuccessfully": "Auto-test passed successfully!", "testNotSuccessful": "The test did not complete successfully." } diff --git a/src/BusinessLogic/Resources/lang/es.json b/src/BusinessLogic/Resources/countries/es.json similarity index 85% rename from src/BusinessLogic/Resources/lang/es.json rename to src/BusinessLogic/Resources/countries/es.json index d914a7ba..c79bf571 100644 --- a/src/BusinessLogic/Resources/lang/es.json +++ b/src/BusinessLogic/Resources/countries/es.json @@ -1,10 +1,5 @@ { "general": { - "packlinkPro": "Packlink PRO Shipping", - "saveUp": "Ahorra hasta un 70% en tus gastos de envío. Sin tarifas fijas, sin volumen de envíos mínimo. Gestiona todos tus envíos en una sola plataforma.", - "packlinkShipping": "Packlink Shipping S.L.", - "noContract": "Sin contratos, accede inmediatamente a más de 300 servicios de transporte en una única plataforma. No importa cuantos puntos de venta tengas, todo lo podrás gestionar desde Packlink PRO.", - "developedAndManaged": "Desarrollado y gestionado por Packlink", "generalConditions": "Condiciones generales", "basicSettings": "Configuración", "contactUs": "Contacta con nosotros", @@ -48,8 +43,6 @@ "apiKey": "Api key", "apiKeyIncorrect": "Clave de API incorrecta", "dontHaveAccount": "¿No tienes una cuenta?", - "welcome": "Te damos la bienvenida a Packlink PRO", - "connectYourService": "Conecta tu servicio mediante tu clave. La encontrarás en la
sección \"Configuración\" apartado \"Packlink Pro API Key\"", "validateApiKey": "Validar API key", "chooseYourCountry": "Elige tu país para comenzar el registro", "registerMe": "Registrarme" @@ -83,13 +76,10 @@ "email": "Correo electrónico", "password": "Contraseña", "haveAccount": "¿Ya tienes una cuenta?", - "startEnjoying": "¡Empieza a disfrutar de Packlink PRO!", "registerAccount": "Registro", "getToKnowYou": "Queremos conocerte mejor para adaptarnos a ti y hacerte una propuesta personalizada.", "monthlyShipmentVolume": "¿Cuántos envíos sueles hacer al mes?", "phone": "Teléfono", - "termsAndConditions": "
Acepto los Términos y condiciones y la Política de privacidad de Packlink
", - "marketingEmails": "Autorizo a Packlink Shipping S.L. a enviarme información comercial por correo electrónico", "submit": "Regístrate", "chooseYourCountry": "Elige tu país", "searchCountry": "Busca el país", @@ -160,8 +150,6 @@ }, "orderStatusMapping": { "title": "Estado de la orden", - "description": "Con Packlink puedes actualizar el estado de tu pedido de %s con la información de envío.
Puedes editarla en cualquier momento.", - "packlinkProShipmentStatus": "ESTADO DEL ENVÍO de Packlink PRO", "systemOrderStatus": "ESTADO DEL PEDIDO de %s", "none": "Ninguno", "pending": "Pendiente", @@ -211,11 +199,9 @@ "origin": "Origen", "destination": "Destino", "myPrices": "Mis precios", - "packlinkPrices": "Precios de Packlink", "configureService": "Configura el servicio", "showCarrierLogo": "Mostrar logo del transportista a mis clientes.", "pricePolicy": "Política de precios", - "pricePolicyDescription": "Por defecto serán los precios base de Packlink. Pero puedes configurarlos de manera más precisa a continuación.", "configurePricePolicy": "Configurar mis precios de envío", "taxClassTitle": "Elige tu tipo de impuesto guardado", "tax": "Impuestos", @@ -241,9 +227,6 @@ "weightAndPriceRangeWithData": "Rango de peso y precio: desde %s kg hasta %s kg y desde %s€ hasta %s€", "singlePricePolicy": "Política de precio %s", "pricePolicyExplanation": "2- Elige una política de precios y configúrala.", - "packlinkPrice": "Precio Packlink", - "percentagePacklinkPrices": "% de los precio de Packlink", - "percentagePacklinkPricesWithData": "% de los precio de Packlink: %s por %s%", "fixedPrices": "Precio fijo", "fixedPricesWithData": "Precio fijo: %s€", "increaseExplanation": "Incrementar: añade un % al precio, lo pagará el cliente.", @@ -255,17 +238,14 @@ "selectAllCountries": "Selecionar todos los países", "selectCountriesHeader": "Países permitidos para tu servicio
de envío", "selectCountriesSubheader": "Selecciona la disponibilidad de al menos un país y
añade tantos como necesites", - "usePacklinkRange": "Para el resto de rangos, aplicar precios Packlink", "discardChangesQuestion": "Algunos cambios no se han guardado.
¿Estás seguro de que quieres volver e ignorar los cambios?", "atLeastOneCountry": "" }, "orderListAndDetails": { - "packlinkOrderDraft": "Borrador del pedido de Packlink", "printed": "Impreso", "ready": "Listo", "printLabel": "Imprimir etiquetas", "shipmentLabels": "Etiquetas de los envíos", - "printShipmentLabels": "Imprimir Packlink PRO etiquetas de los envíos", "shipmentDetails": "Detalles del envío", "disablePopUpBlocker": "Deshabilita el bloqueador de elementos emergentes en esta página para abrir de forma masiva las etiquetas de envío", "date": "Fecha", @@ -274,21 +254,14 @@ "print": "Imprimir", "carrierTrackingNumbers": "Número de tracking del transportista", "trackIt": "Seguimiento", - "packlinkReferenceNumber": "Número de referencia Packlink", - "packlinkShippingPrice": "Precio de envío de Packlink", - "viewOnPacklink": "Ver en Packlink PRO", "createDraft": "Crear borrador", - "draftIsBeingCreated": "El borrador se está creando actualmente en Packlink PRO", - "createOrderDraft": "Crear borrador en Packlink PRO", "draftCreateFailed": "El intento anterior de crear un borrador ha fallado. Error: %s", - "packlinkShipping": "Packlink Shipping", "shipmentOrderNotExist": "El pedido con referencia de envío %s no existe en la tienda", "orderDetailsNotFound": "Detalles del pedido no encontrados", "orderNotExist": "El pedido con ID %s no existe en la tienda", "bulkFailCreateFail": "No se puede crear el archivo de etiquetas masivas", "draftOrderDelayed": "La creación del borrador se ha retrasado", - "completeServicesSetup": "You need to complete the services setup to create order draft.", - "sendWithPacklink": "Send with Packlink" + "completeServicesSetup": "You need to complete the services setup to create order draft." }, "checkoutProcess": { "choseDropOffLocation": "Este servicio de envío admite la entrega a ubicaciones de entrega predefinidas. Elige la ubicación que más te convenga haciendo clic en el botón \"Seleccionar ubicación de entrega\"..", @@ -331,7 +304,6 @@ }, "systemLogMessages": { "errorCreatingDefaultTask": "Error creating default task runner status configuration.", - "webhookReceived": "Webhook de Packlink recibido", "couldNotDelete": "No se pudo eliminar la entidad %s con ID %s", "entityCannotBeSaved": "La entidad %s con ID %s no se puede guardar.", "entityCannotBeUpdated": "La entidad %s con ID %s no se puede actualizar.", @@ -344,11 +316,8 @@ "autoTest": { "dbNotAccessible.": "DNo se puede acceder a la base de datos.", "taskCouldNotBeStarted.": "No se ha podido iniciar la tarea.", - "moduleAutoTest": "Prueba automática del módulo PacklinkPRO", - "useThisPageTestConfiguration": "Utiliza esta página para probar la configuración del sistema y los servicios del módulo PacklinkPRO.", "start": "Inicio", "downloadTestLog": "Descargar el registro de pruebas", - "openModule": "Abrir el módulo PacklinkPRO", "autotestPassedSuccessfully": "Prueba automática superada con éxito.", "testNotSuccessful": "La prueba no se ha completado correctamente." } diff --git a/src/BusinessLogic/Resources/lang/fr.json b/src/BusinessLogic/Resources/countries/fr.json similarity index 85% rename from src/BusinessLogic/Resources/lang/fr.json rename to src/BusinessLogic/Resources/countries/fr.json index 123550f2..a9584db6 100644 --- a/src/BusinessLogic/Resources/lang/fr.json +++ b/src/BusinessLogic/Resources/countries/fr.json @@ -1,10 +1,5 @@ { "general": { - "packlinkPro": "Packlink PRO Shipping", - "saveUp": "Économisez jusqu'à 70% sur vos coûts de livraison. Sans frais fixes, sans volume minimum requis. Gérez tous vos envois depuis une seule plateforme.", - "packlinkShipping": "Packlink Shipping S.L.", - "noContract": "Sans engagement, accédez immédiatement à plus de 300 services de transport sur une seule et unique plateforme. Quelque soit le nombre de points de ventes que vous avez, vous pourrez tout gérer depuis Packlink PRO.", - "developedAndManaged": "Développé et géré par Packlink", "generalConditions": "Conditions générales", "basicSettings": "Paramètres", "contactUs": "Contactez-nous", @@ -48,8 +43,6 @@ "apiKey": "Clé API", "apiKeyIncorrect": "Clé API incorrecte", "dontHaveAccount": "Vous n’avez pas de compte ?", - "welcome": "Bienvenue sur Packlink PRO", - "connectYourService": "Connectez votre service en utilisant votre clé. Vous la trouverez dans la section
« Clé API Packlink Pro » dans « Paramètres ».", "validateApiKey": "Valider clé API", "chooseYourCountry": "Sélectionnez votre pays pour commencer votre inscription", "registerMe": "S’inscrire" @@ -83,13 +76,10 @@ "email": "Adresse électronique", "password": "Mot de passe", "haveAccount": "Vous avez déjà un compte ?", - "startEnjoying": "Commencez à utiliser Packlink PRO !", "registerAccount": "Enregistrez-vous", "getToKnowYou": "Nous souhaitons mieux vous connaître afin de nous adapter à vous et de vous faire une offre sur mesure", "monthlyShipmentVolume": "Combien d’envois faites-vous généralement par mois?", "phone": "Numéro de téléphone", - "termsAndConditions": "
IJ’accepte les Conditions de service et la Politique de confidentialité de Packlink
", - "marketingEmails": "J’autorise Packlink Shipping S.L. à m’envoyer des communications commerciales par courriel", "submit": "S'inscrire", "chooseYourCountry": "Sélectionnez votre pays", "searchCountry": "Rechercher un pays", @@ -160,8 +150,6 @@ }, "orderStatusMapping": { "title": "Statut de la commande", - "description": "Avec Packlink, vous pouvez mettre à jour le statut de votre commande %s avec les informations d’expédition.
Vous pourrez les modifier à tout moment.", - "packlinkProShipmentStatus": "STATUT DE LIVRAISON Packlink PRO", "systemOrderStatus": "STATUT DE LA COMMANDE %s", "none": "Aucun", "pending": "En attente", @@ -211,11 +199,9 @@ "origin": "Origine", "destination": "Destination", "myPrices": "Mes prix", - "packlinkPrices": "Prix Packlink", "configureService": "Configurer le service", "showCarrierLogo": "Montrer le logo du transporteur à mes clients", "pricePolicy": "Politique tarifaire", - "pricePolicyDescription": "Les tarifs de base de Packlink seront configurés par défaut, mais vous pourrez les configurer plus en détail ci-dessous.", "configurePricePolicy": "Configurer mes frais d’expédition", "taxClassTitle": "Sélectionnez votre taux fiscal enregistré", "tax": "Taxe", @@ -241,9 +227,6 @@ "weightAndPriceRangeWithData": "Fourchette de poids et de prix : de %s kg à %s kg et de %s € à %s €", "singlePricePolicy": "Politique tarifaire %s", "pricePolicyExplanation": "2. Choisissez une politique tarifaire et configurez-la.", - "packlinkPrice": "Prix Packlink", - "percentagePacklinkPrices": "% des prix Packlink", - "percentagePacklinkPricesWithData": "% des prix Packlink : %s de %s%", "fixedPrices": "Prix fixe", "fixedPricesWithData": "Prix fixe : %s €", "increaseExplanation": "Augmentation : ajoutez % au prix, c’est le client qui payera.", @@ -255,17 +238,14 @@ "selectAllCountries": "Tous les pays sélectionnés", "selectCountriesHeader": "Pays pris en charge par votre
service d’expédition", "selectCountriesSubheader": "Sélectionnez la disponibilité d’au moins un pays et ajoutez-en
autant que nécessaire", - "usePacklinkRange": "Pour toutes les autres fourchettes, appliquez les prix Packlink", "discardChangesQuestion": "Certaines modifications n’ont pas été enregistrées.
Êtes-vous sûr de vouloir revenir en arrière et de les ignorer ?", "atLeastOneCountry": "" }, "orderListAndDetails": { - "packlinkOrderDraft": "Brouillon de commande Packlink", "printed": "Imprimé", "ready": "Prêt", "printLabel": "Imprimer étiquette", "shipmentLabels": "Étiquettes de livraison", - "printShipmentLabels": "Imprimer les étiquettes de livraison Packlink PRO", "shipmentDetails": "Détails de l'envoi", "disablePopUpBlocker": "Veuillez désactiver l'outil de blocage des fenêtres pop-up sur cette page afin d'ouvrir massivement les étiquettes d'envoi.", "date": "Date", @@ -274,21 +254,14 @@ "print": "Imprimer", "carrierTrackingNumbers": "Numéro de tracking du transporteur", "trackIt": "Suivez le!", - "packlinkReferenceNumber": "Numéro de référence Packlink", - "packlinkShippingPrice": "Prix de livraison Packlink", - "viewOnPacklink": "Voir sur Packlink PRO", "createDraft": "Créer un brouillon", - "draftIsBeingCreated": "Le brouillon est en cours de création sur Packlink PRO", - "createOrderDraft": "Créer un brouillon de commande sur Packlink PRO", "draftCreateFailed": "La tentative précédente de création d'un brouillon a échoué. Erreur: %s", - "packlinkShipping": "Packlink Shipping", "shipmentOrderNotExist": "La commande de livraison sous le référence %s n'existe pas sur le shop.", "orderDetailsNotFound": "Détails de commande introuvables", "orderNotExist": "La commande sous l'ID %s n'existe pas sur le shop.", "bulkFailCreateFail": "Création d'un dossier d'étiquettes en masse impossible.", "draftOrderDelayed": "La création du brouillon a été retardée", - "completeServicesSetup": "You need to complete the services setup to create order draft.", - "sendWithPacklink": "Send with Packlink" + "completeServicesSetup": "You need to complete the services setup to create order draft." }, "checkoutProcess": { "choseDropOffLocation": "Ce service de transport soutient la livraison vers des lieux de dépôts prédéfinis. Veuillez choisir la localisation qui vous convient le mieux en cliquant sur le bouton \"Sélectionner le lieu de dépôt\"", @@ -331,7 +304,6 @@ }, "systemLogMessages": { "errorCreatingDefaultTask": "Erreur lors de la création de la configuration du gestionnaire de tâches par défaut.", - "webhookReceived": "Webhook de Packlink reçu", "couldNotDelete": "L'entité %s dont l'ID est %s n'a pas pu être supprimée.", "entityCannotBeSaved": "L'entité %s dont l'ID est %s n'a pas pu être enregistrée.", "entityCannotBeUpdated": "L'entité %s dont l'ID est %s n'a pas pu être mise à jour.", @@ -344,11 +316,8 @@ "autoTest": { "dbNotAccessible.": "Base de données inaccessible.", "taskCouldNotBeStarted.": "La tâche n’a pu être lancée.", - "moduleAutoTest": "Test automatique du module PacklinkPRO", - "useThisPageTestConfiguration": "Utilisez cette page pour tester la configuration du système et les services du module PacklinkPRO.", "start": "Démarrer", "downloadTestLog": "Télécharger le registre de tests", - "openModule": "Ouvrir le module PacklinkPRO", "autotestPassedSuccessfully": "Test automatique réussi avec succès !", "testNotSuccessful": "Le test a échoué." } diff --git a/src/BusinessLogic/Resources/lang/fromCSV.php b/src/BusinessLogic/Resources/countries/fromCSV.php similarity index 96% rename from src/BusinessLogic/Resources/lang/fromCSV.php rename to src/BusinessLogic/Resources/countries/fromCSV.php index 5968a5d9..cb62008e 100644 --- a/src/BusinessLogic/Resources/lang/fromCSV.php +++ b/src/BusinessLogic/Resources/countries/fromCSV.php @@ -35,7 +35,7 @@ function fromCsv() function exportJson($lang, $data) { file_put_contents( - __DIR__ . "/$lang.json", + __DIR__ . "/fromCSV.php", str_replace( ' ', ' ', diff --git a/src/BusinessLogic/Resources/lang/it.json b/src/BusinessLogic/Resources/countries/it.json similarity index 85% rename from src/BusinessLogic/Resources/lang/it.json rename to src/BusinessLogic/Resources/countries/it.json index 32edd36f..2f8c05e9 100644 --- a/src/BusinessLogic/Resources/lang/it.json +++ b/src/BusinessLogic/Resources/countries/it.json @@ -1,10 +1,5 @@ { "general": { - "packlinkPro": "Packlink PRO Shipping", - "saveUp": "Risparmia fino a un 70% sui costi di spedizione. Senza costi fissi né volumi minimi di spedizione richiesti. Gestisci tutte le tue spedizioni da un'unica piattaforma.", - "packlinkShipping": "Packlink Shipping S.L.", - "noContract": "Senza contratti, accedi suvito a più di 300 servizi di trasporto da un'unica piattaforma. Indipendentemente da quanti punti vendita hai, puoi gestirli tutto da Packlink PRO.", - "developedAndManaged": "Sviluppato e gestito da Packlink", "generalConditions": "Condizioni generali", "basicSettings": "Configurazione", "contactUs": "Contattaci", @@ -48,8 +43,6 @@ "apiKey": "API Key", "apiKeyIncorrect": "API Key non corretta", "dontHaveAccount": "Non hai un account?", - "welcome": "Benvenuto a Packlink PRO", - "connectYourService": "Usa la chiave per collegare il tuo servizio. La troverai nella sezione
\"Chiave API Packlink Pro\" delle \"Impostazioni\".", "validateApiKey": "Convalida la chiave API", "chooseYourCountry": "Per iniziare la registrazione, scegli il tuo paese", "registerMe": "Iscriviti" @@ -83,13 +76,10 @@ "email": "Email", "password": "Password", "haveAccount": "Hai già un account?", - "startEnjoying": "Inizia a usufruire di Packlink PRO!", "registerAccount": "Registrati", "getToKnowYou": "Vogliamo conoscerti meglio per adattarci a te e preparare una proposta personalizzata per te", "monthlyShipmentVolume": "Quante spedizioni fai solitamente al mese?", "phone": "Numero di telefono", - "termsAndConditions": "
Accetto i Termini del servizio e l’Informativa sulla privacy di Packlink
", - "marketingEmails": "Autorizzo Packlink Shipping S.L. a inviarmi comunicazioni commerciali via email", "submit": "Registrati", "chooseYourCountry": "Scegli il paese", "searchCountry": "Cerca paese", @@ -160,8 +150,6 @@ }, "orderStatusMapping": { "title": "Stato dell’ordine", - "description": "Con Packlink, puoi aggiornare lo stato dell’ordine %s con i dati della spedizione.
Puoi modificarlo ogni volta che vuoi.", - "packlinkProShipmentStatus": "STATO DELLA SPEDIZIONE di Packlink PRO", "systemOrderStatus": "STATO DELLA SPEDIZIONE di %s", "none": "Nessuno", "pending": "In attesa", @@ -211,11 +199,9 @@ "origin": "Origine", "destination": "Destinazione", "myPrices": "I miei prezzi", - "packlinkPrices": "Prezzi di Packlink", "configureService": "Configura il servizio", "showCarrierLogo": "Mostra logo del corriere ai miei clienti", "pricePolicy": "Politica dei prezzi", - "pricePolicyDescription": "Per impostazione predefinita, saranno i prezzi di base di Packlink, ma puoi configurarli più dettagliatamente qui di seguito.", "configurePricePolicy": "Configura i prezzi di spedizione", "taxClassTitle": "Scegli la tua aliquota fiscale salvata", "tax": "Tassa", @@ -241,9 +227,6 @@ "weightAndPriceRangeWithData": "Range di prezzo e di peso: da %s kg a %s kg e da %s€ a %s€", "singlePricePolicy": "Politica dei prezzi %s", "pricePolicyExplanation": "2. Scegli una politica dei prezzi e configurala.", - "packlinkPrice": "Prezzo di Packlink", - "percentagePacklinkPrices": "% dei prezzi di Packlink", - "percentagePacklinkPricesWithData": "% dei prezzi di Packlink: %s del %s%", "fixedPrices": "Prezzo fisso", "fixedPricesWithData": "Prezzo fisso: %s€", "increaseExplanation": "Incremento sul prezzo: aggiungi una % al prezzo, che sarà pagata dal cliente.", @@ -255,17 +238,14 @@ "selectAllCountries": "Tutti i paesi selezionati", "selectCountriesHeader": "Paesi supportati per il tuo
servizio di spedizione", "selectCountriesSubheader": "Seleziona la disponibilità di almeno un paese e aggiungi
tutti quelli richiesti", - "usePacklinkRange": "Per tutti gli altri range, applica i prezzi di Packlink", "discardChangesQuestion": "Alcune modifiche non sono state salvate.
Sei sicuro di voler tornare indietro e annullarle?", "atLeastOneCountry": "" }, "orderListAndDetails": { - "packlinkOrderDraft": "Bozza dell'ordine Packlink", "printed": "Stampato", "ready": "Pronto per la spedizione", "printLabel": "Stampa etichette", "shipmentLabels": "Etichette di spedizione", - "printShipmentLabels": "Stampa etichette di spedizione Packlink PRO", "shipmentDetails": "Dettagli della spedizione", "disablePopUpBlocker": "Disabilita il blocco pop-up su questa pagina per poter aprire le etichette di spedizione insieme", "date": "Data", @@ -274,21 +254,14 @@ "print": "Stampa", "carrierTrackingNumbers": "Numero di tracking del corriere", "trackIt": "Traccialo!", - "packlinkReferenceNumber": "Numero di ordine Packlink", - "packlinkShippingPrice": "PPrezzo di spedizione Packlink", - "viewOnPacklink": "Vedi su Packlink PRO", "createDraft": "Crea bozza", - "draftIsBeingCreated": "La bozza è attualmente in fase di creazione su Packlink PRO", - "createOrderDraft": "Crea una bozza di ordine su Packlink PRO", "draftCreateFailed": "Il precedente tentativo di creare una bozza è fallito. Errore: %s", - "packlinkShipping": "Packlink Shipping", "shipmentOrderNotExist": "L'ordine con il numero di spedizione %s non esiste nel negozio", "orderDetailsNotFound": "Dettagli dell'ordine non trovati", "orderNotExist": "L'ordine con ID %s non esiste nel negozio", "bulkFailCreateFail": "Impossibile creare il file di etichette in blocco", "draftOrderDelayed": "La creazione della bozza è stata ritardata", - "completeServicesSetup": "You need to complete the services setup to create order draft.", - "sendWithPacklink": "Send with Packlink" + "completeServicesSetup": "You need to complete the services setup to create order draft." }, "checkoutProcess": { "choseDropOffLocation": "Questo servizio di spedizione supporta la consegna a punti corriere predefiniti. Scegli la località più adatta a te, facendo clic sul pulsante \"Seleziona punto corriere\".", @@ -331,7 +304,6 @@ }, "systemLogMessages": { "errorCreatingDefaultTask": "Error creating default task runner status configuration.", - "webhookReceived": "Webhook di Packlink ricevuto", "couldNotDelete": "Impossibile eliminare l'entità %s con ID %s", "entityCannotBeSaved": "L'entità %s con ID %s non può essere salvata.", "entityCannotBeUpdated": "L'entità %s con ID %s non può essere aggiornata.", @@ -344,11 +316,8 @@ "autoTest": { "dbNotAccessible.": "Database non accessibile.", "taskCouldNotBeStarted.": "Non è stato possibile avviare l’attività.", - "moduleAutoTest": "Auto-test per il modulo di PacklinkPRO", - "useThisPageTestConfiguration": "Usa questa pagina per testare la configurazione del sistema e i servizi del modulo di PacklinkPRO.", "start": "Avvia", "downloadTestLog": "Scarica il registro test", - "openModule": "Apri il modulo di PacklinkPRO", "autotestPassedSuccessfully": "L’auto-test è stato superato con successo!", "testNotSuccessful": "Il test non è stato completato correttamente." } diff --git a/src/BusinessLogic/Resources/lang/toCSV.php b/src/BusinessLogic/Resources/countries/toCSV.php similarity index 100% rename from src/BusinessLogic/Resources/lang/toCSV.php rename to src/BusinessLogic/Resources/countries/toCSV.php diff --git a/src/BusinessLogic/Resources/lang/translations.csv b/src/BusinessLogic/Resources/countries/translations.csv similarity index 100% rename from src/BusinessLogic/Resources/lang/translations.csv rename to src/BusinessLogic/Resources/countries/translations.csv diff --git a/src/BusinessLogic/Resources/js/RegisterController.js b/src/BusinessLogic/Resources/js/RegisterController.js index 7ae525f5..4da6b48a 100644 --- a/src/BusinessLogic/Resources/js/RegisterController.js +++ b/src/BusinessLogic/Resources/js/RegisterController.js @@ -42,9 +42,6 @@ if (!window.Packlink) { templateService.getComponent('pl-go-to-login', registerPage).addEventListener('click', goToLogin); - templateService.getComponent('pl-register-platform-country', registerPage).value = - additionalConfig.hasOwnProperty('platform_country') ? additionalConfig.platform_country : 'ES'; - initInputField('pl-register-email'); initInputField('pl-register-password'); initInputField('pl-register-phone'); @@ -60,17 +57,20 @@ if (!window.Packlink) { * phone: string, * source: string, * termsAndConditionsUrl: string, - * privacyPolicyUrl: string + * privacyPolicyUrl: string, + * platform_country: string * }} response */ const populateInitialValues = (response) => { const emailInput = templateService.getComponent('pl-register-email'), phoneInput = templateService.getComponent('pl-register-phone'), - sourceInput = templateService.getComponent('pl-register-source'); + sourceInput = templateService.getComponent('pl-register-source'), + platformCountry = templateService.getComponent('pl-register-platform-country'); emailInput.value = response.email; phoneInput.value = response.phone; sourceInput.value = response.source; + platformCountry.value = response.platform_country; let termsAndConditionsLabel = templateService.getComponent('pl-register-terms-and-conditions-label'), termsTranslation = translationService.translate( diff --git a/src/BusinessLogic/Resources/js/RegisterModalController.js b/src/BusinessLogic/Resources/js/RegisterModalController.js index 6fec3cfe..92e1a095 100644 --- a/src/BusinessLogic/Resources/js/RegisterModalController.js +++ b/src/BusinessLogic/Resources/js/RegisterModalController.js @@ -10,9 +10,7 @@ if (!window.Packlink) { * @typedef {{ * name: string, * code: string, - * postal_code: string, - * registration_link: string, - * platform_country: string + * postal_code: string * }} Country */ @@ -73,7 +71,7 @@ if (!window.Packlink) { */ const handleCountrySelected = (country) => { modal.close(); - Packlink.state.goToState('register', {country: country.code, platform_country: country.platform_country}); + Packlink.state.goToState('register', {country: country.code}); }; /** diff --git a/src/BusinessLogic/Resources/templates/configuration.html b/src/BusinessLogic/Resources/templates/configuration.html index 0c7ef492..00657bb3 100644 --- a/src/BusinessLogic/Resources/templates/configuration.html +++ b/src/BusinessLogic/Resources/templates/configuration.html @@ -49,7 +49,7 @@

{$configuration.menu}