summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorosab2018-02-25 12:43:04 (GMT)
committerBojan Zivanovic2018-02-25 12:43:04 (GMT)
commit1db38f5c949711565adb7f5aa70b96eea3c9c818 (patch)
treee18ad0e1ceddb64fa934bea80821fa1ceeaaf961
parent0b1f41cb79557050fd5abb24a4c74031e298118c (diff)
Issue #2917372 by osab, andypost, joachim, mglaman: incorrect use of translation in CartEventSubscriber
-rw-r--r--modules/cart/src/EventSubscriber/CartEventSubscriber.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/cart/src/EventSubscriber/CartEventSubscriber.php b/modules/cart/src/EventSubscriber/CartEventSubscriber.php
index 991c018..63b05ca 100644
--- a/modules/cart/src/EventSubscriber/CartEventSubscriber.php
+++ b/modules/cart/src/EventSubscriber/CartEventSubscriber.php
@@ -7,7 +7,7 @@ use Drupal\commerce_cart\Event\CartEntityAddEvent;
use Drupal\commerce_cart\Event\CartEvents;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
-use Drupal\Core\Link;
+use Drupal\Core\Url;
class CartEventSubscriber implements EventSubscriberInterface {
@@ -41,9 +41,9 @@ class CartEventSubscriber implements EventSubscriberInterface {
*/
public function displayAddToCartMessage(CartEntityAddEvent $event) {
$purchased_entity = $event->getEntity();
- drupal_set_message($this->t('@entity added to @cart-link.', [
+ drupal_set_message($this->t('@entity added to <a href=":url">your cart</a>.', [
'@entity' => $purchased_entity->label(),
- '@cart-link' => Link::createFromRoute($this->t('your cart', [], ['context' => 'cart link']), 'commerce_cart.page')->toString(),
+ ':url' => Url::fromRoute('commerce_cart.page')->toString(),
]));
}