From 8a4daa4e9151354523d2e2e7508ba7730dc92a3b Mon Sep 17 00:00:00 2001 From: Tilen Gombac Date: Fri, 28 Oct 2022 14:44:55 +0200 Subject: [PATCH] Pass current language id to inline template --- .../src/Controller/ReturnCallController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/drupal9/web/modules/custom/trgovina_1ka/src/Controller/ReturnCallController.php b/frontend/drupal9/web/modules/custom/trgovina_1ka/src/Controller/ReturnCallController.php index 9c827bf7f..73b372b11 100644 --- a/frontend/drupal9/web/modules/custom/trgovina_1ka/src/Controller/ReturnCallController.php +++ b/frontend/drupal9/web/modules/custom/trgovina_1ka/src/Controller/ReturnCallController.php @@ -22,6 +22,11 @@ class ReturnCallController extends ControllerBase 'description' => [ '#type' => 'inline_template', '#template' => $template, + '#context' => [ + 'language' => [ + 'id' => \Drupal::languageManager()->getCurrentLanguage()->getId(), + ], + ], ], ]; @@ -39,6 +44,11 @@ class ReturnCallController extends ControllerBase 'description' => [ '#type' => 'inline_template', '#template' => $template, + '#context' => [ + 'language' => [ + 'id' => \Drupal::languageManager()->getCurrentLanguage()->getId(), + ], + ], ], ];