diff --git a/core/lib/Drupal/Core/Template/TwigNodeTrans.php b/core/lib/Drupal/Core/Template/TwigNodeTrans.php
index 29dea5a..cdfd0af 100644
--- a/core/lib/Drupal/Core/Template/TwigNodeTrans.php
+++ b/core/lib/Drupal/Core/Template/TwigNodeTrans.php
@@ -83,7 +83,7 @@ public function compile(\Twig_Compiler $compiler) {
     $compiler->raw(')');
 
     // Append translation debug markup, if necessary.
-    if (Settings::get('twig_debug', FALSE)) {
+    if ($compiler->env->isDebug()) {
       $compiler->raw(" . '\n<!-- TRANSLATION: ");
       $compiler->subcompile($singular);
       if (!empty($plural)) {
