From 95237625216c0e205490b1558fe75190cf2d013d Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Wed, 2 Apr 2014 16:47:33 +0200 Subject: [PATCH 1/4] Improved french translation, fixed some english strings. --- templates/backOffice/default/I18n/fr_FR.php | 10 ++++------ templates/backOffice/default/categories.html | 4 ++-- templates/backOffice/default/translations.html | 5 +---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/templates/backOffice/default/I18n/fr_FR.php b/templates/backOffice/default/I18n/fr_FR.php index df1a0e9b4..195acdb9c 100644 --- a/templates/backOffice/default/I18n/fr_FR.php +++ b/templates/backOffice/default/I18n/fr_FR.php @@ -6,10 +6,8 @@ return array( '(edit)' => '(modification)', 'Check the list of ISO 639-1 codes' => 'Consulter la liste des codes ISO 639-1', '0 combinations' => '0 combinaisons', - 'Cannot translate all fields. According to your PHP configuration, forms cannot contains more than - %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration - of change the translation file by hand.' => 'Cannot translate all fields. According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.', - 'Congratulations, all text is now translated !' => 'Félicitations, Toute la traduction a été effectué', + 'Cannot translate all fields. According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.' => 'Limitation système bloquante ! Votre configuration PHP limite le nombre de champs d\'une forme HTML à %current_max_input_vars champs. Au moins %required_max_input_vars champs sont nécessaires pour effectuer les traductions. Merci de modifier en conséquence la variable max_input_vars de votre configuration PHP. Vous pouvez aussi modifier les fichiers de traduction à la main.', + 'Congratulations, all text is now translated !' => 'Félicitations, tous les textes ont été traduits !', 'Did not found any text to translate. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.' => 'Aucun texte à traduire. C\'est probablement normal. Si ce n\'est pas le cas vérifiez que vous utilisez bien la fonction Smarty "intl" ou bien le translator Translator::trans dans un fichier php', 'A content could be attached to more than one folder. Select here the additional folders for this content.' => 'Un contenu peut être rattaché à plusieurs dossiers. Sélectionnez ici les dossiers dans lesquels ce contenu apparaîtra', 'A product could be attached to more than one category. Select here the additional categories for this product.' => 'Un produit peut être associé à plusieurs rubriques. Sélectionner les rubrique pour lesquels le produit sera associé', @@ -423,9 +421,9 @@ return array( 'Enter here the folder name in the default language (%title)' => 'Entrez ici le nom du dossier dans la langue par défaut (%title)', 'Enter here the mailing template purpose in the default language (%title)' => 'Renseigner l\'objet du mail dans la langue par défaut (%title)', 'Enter here the product name in the default language (%title)' => 'Entrez ici le nom du produit dans la langue par défaut (%title)', - 'Enter here the product price in the default currency (%title)' => 'entrez ici le prix du produit dans la langue par défaut (%title)', + 'Enter here the product price in %title' => 'Indiquez ici le prix HT en %title ', 'Enter here the product reference' => 'Entrez ici la nouvelle référence produit', - 'Enter here the product tax price in the default currency (%title)' => 'Renseignez le prox TTC dans la devise par défaut (%title)', + 'Enter here the product tax price in %title' => 'Indiquez ici le prix TTC en %title ', 'Enter here the product weight, in Kilogrammes' => 'Entrez ici le poids du produit, en Kilogrammes', 'Enter here the template name in the default language (%title)' => 'Renseignez le nom du template dans la langue par défaut (%title)', 'Enter here the value in the current edit language (%language_name)' => 'Rensignez la valeur dans la langue d\'édition actuelle (%language_name)', diff --git a/templates/backOffice/default/categories.html b/templates/backOffice/default/categories.html index cdf42bf70..4d4952f8e 100644 --- a/templates/backOffice/default/categories.html +++ b/templates/backOffice/default/categories.html @@ -505,7 +505,7 @@ -
{intl l='Enter here the product price in the default currency (%title)' title=$NAME}
+
{intl l='Enter here the product price in %title' title=$NAME}
{form_field form=$form field='currency'} @@ -529,7 +529,7 @@ -
{intl l='Enter here the product tax price in the default currency (%title)' title=$NAME}
+
{intl l='Enter here the product tax price in %title' title=$NAME}
{/loop} {/form_field} diff --git a/templates/backOffice/default/translations.html b/templates/backOffice/default/translations.html index bbcd7c6c0..9ceb8efd9 100644 --- a/templates/backOffice/default/translations.html +++ b/templates/backOffice/default/translations.html @@ -241,10 +241,7 @@ {if $max_input_vars_warning}
- {intl l='Cannot translate all fields. According to your PHP configuration, forms cannot contains more than - %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration - of change the translation file by hand.' - + {intl l='Cannot translate all fields. According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.' current_max_input_vars=$current_max_input_vars required_max_input_vars=$required_max_input_vars } From c39a9441727e01169fb4da861ce3f1553cfdb41e Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Fri, 4 Apr 2014 02:31:13 +0200 Subject: [PATCH 2/4] Added typing in assign() method comment to prevent PhpStorm warning --- core/lib/Thelia/Core/Template/ParserInterface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Core/Template/ParserInterface.php b/core/lib/Thelia/Core/Template/ParserInterface.php index 9ec99360c..6156ca859 100644 --- a/core/lib/Thelia/Core/Template/ParserInterface.php +++ b/core/lib/Thelia/Core/Template/ParserInterface.php @@ -62,8 +62,8 @@ interface ParserInterface /** * Create a variable that will be available in the templates * - * @param $variable the vatiable name - * @param $value the value of the variable + * @param string $variable the variable name + * @param mixed $value the value of the variable */ public function assign($variable, $value); } From dc22938512dbee339cb2dcc475368ea0b24a1a92 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Fri, 4 Apr 2014 02:31:51 +0200 Subject: [PATCH 3/4] Added isPaymentModuleFor() and isDeliveryModuleFor() toi BaseModule --- core/lib/Thelia/Module/BaseModule.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/core/lib/Thelia/Module/BaseModule.php b/core/lib/Thelia/Module/BaseModule.php index 6dcf3ff06..92ca5458f 100644 --- a/core/lib/Thelia/Module/BaseModule.php +++ b/core/lib/Thelia/Module/BaseModule.php @@ -33,6 +33,7 @@ use Thelia\Model\Map\ModuleTableMap; use Thelia\Model\ModuleI18nQuery; use Thelia\Model\Map\ModuleImageTableMap; use Thelia\Model\ModuleI18n; +use Thelia\Model\Order; use Thelia\Tools\Image; use Thelia\Exception\ModuleException; use Thelia\Model\Module; @@ -262,6 +263,30 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return basename(dirname($this->reflected->getFileName())); } + /** + * Check if this module is the payment module for a given order + * + * @param Order $order an order + * @return bool true if this module is the payment module for the given order. + */ + public function isPaymentModuleFor(Order $order) { + $model = $this->getModuleModel(); + + return $order->getPaymentModuleId() == $model->getId(); + } + + /** + * Check if this module is the delivery module for a given order + * + * @param Order $order an order + * @return bool true if this module is the delivery module for the given order. + */ + public function isDeliveryModuleFor(Order $order) { + $model = $this->getModuleModel(); + + return $order->getDeliveryModuleId() == $model->getId(); + } + /** * * This method allow adding new compilers to Thelia container From 5eac9ba54661c2062004590f31db1fb997adbd15 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Fri, 4 Apr 2014 02:33:22 +0200 Subject: [PATCH 4/4] form_field return more information from the field descriptor --- core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php index 92ad357f2..59bde6905 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php @@ -134,6 +134,9 @@ class Form extends AbstractSmartyPlugin $template->assign("value", $fieldValue); $template->assign("checked", isset($fieldVars['checked']) ? $fieldVars['checked'] : false); + $template->assign("choices", isset($fieldVars['choices']) ? $fieldVars['choices'] : false); + $template->assign("multiple", isset($fieldVars['multiple']) ? $fieldVars['multiple'] : false); + //data $template->assign("data", $fieldVars['data']);