Add Translator on all controllers & forms text strings
This commit is contained in:
@@ -109,7 +109,7 @@ class CartAdd extends BaseForm
|
||||
$product = ProductQuery::create()->findPk($value);
|
||||
|
||||
if (is_null($product) || $product->getVisible() == 0) {
|
||||
throw new ProductNotFoundException(Translator::getInstance()->trans(sprintf("this product id does not exists : %d", $value)));
|
||||
throw new ProductNotFoundException(sprintf(Translator::getInstance()->trans("this product id does not exists : %d"), $value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ class CartAdd extends BaseForm
|
||||
->count();
|
||||
|
||||
if ($productSaleElements == 0) {
|
||||
throw new StockNotFoundException(Translator::getInstance()->trans(sprintf("This product_sale_elements_id does not exists for this product : %d", $value)));
|
||||
throw new StockNotFoundException(sprintf(Translator::getInstance()->trans("This product_sale_elements_id does not exists for this product : %d"), $value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class OrderDelivery extends BaseForm
|
||||
$moduleReflection = new \ReflectionClass($module->getFullNamespace());
|
||||
if ($moduleReflection->isSubclassOf("Thelia\Module\DeliveryModuleInterface") === false) {
|
||||
$context->addViolation(
|
||||
Translator::getInstance()->trans(sprintf("delivery module %s is not a Thelia\Module\DeliveryModuleInterface", $module->getCode()))
|
||||
sprintf(Translator::getInstance()->trans("delivery module %s is not a Thelia\Module\DeliveryModuleInterface"), $module->getCode())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class OrderPayment extends BaseForm
|
||||
$moduleReflection = new \ReflectionClass($module->getFullNamespace());
|
||||
if ($moduleReflection->isSubclassOf("Thelia\Module\PaymentModuleInterface") === false) {
|
||||
$context->addViolation(
|
||||
Translator::getInstance()->trans(sprintf("delivery module %s is not a Thelia\Module\PaymentModuleInterface", $module->getCode()))
|
||||
sprintf(Translator::getInstance()->trans("delivery module %s is not a Thelia\Module\PaymentModuleInterface"), $module->getCode())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user