From 68f7879952d3b5e82b9f37826edf39cb221c8eea Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Thu, 9 Oct 2014 11:35:43 -0700
Subject: [PATCH] Issue #2353393 by tstoeckler: Use
 LanguageInterface::DIRECTION_LTR instead of 'ltr' directly.

---
 core/lib/Drupal/Core/Render/Element/MachineName.php            | 3 ++-
 core/modules/color/color.module                                | 3 ++-
 core/modules/views/src/Plugin/views/display/PathPluginBase.php | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/core/lib/Drupal/Core/Render/Element/MachineName.php b/core/lib/Drupal/Core/Render/Element/MachineName.php
index ade389453c32..f062a8c67be9 100644
--- a/core/lib/Drupal/Core/Render/Element/MachineName.php
+++ b/core/lib/Drupal/Core/Render/Element/MachineName.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Language\LanguageInterface;
 
 /**
  * Provides a machine name render element.
@@ -131,7 +132,7 @@ public static function processMachineName(&$element, FormStateInterface $form_st
     if (!isset($element['#attributes'])) {
       $element['#attributes'] = array();
     }
-    $element['#attributes'] += array('dir' => 'ltr');
+    $element['#attributes'] += array('dir' => LanguageInterface::DIRECTION_LTR);
 
     // The source element defaults to array('name'), but may have been overridden.
     if (empty($element['#machine_name']['source'])) {
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index b192709ca1d8..abf4d4546a8b 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\Element\Textfield;
 use Drupal\Core\Routing\RouteMatchInterface;
 
@@ -272,7 +273,7 @@ function color_scheme_form($complete_form, FormStateInterface $form_state, $them
         '#value_callback' => 'color_palette_color_value',
         '#default_value' => $value,
         '#size' => 8,
-        '#attributes' => array('dir' => 'ltr'),
+        '#attributes' => array('dir' => LanguageInterface::DIRECTION_LTR),
       );
     }
   }
diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
index f3d90cef7620..a553edc36277 100644
--- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Routing\UrlGeneratorTrait;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Routing\RouteCompiler;
@@ -398,7 +399,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
           '#default_value' => $this->getOption('path'),
           '#field_prefix' => '<span dir="ltr">' . $this->url('<none>', [], ['absolute' => TRUE]),
           '#field_suffix' => '</span>&lrm;',
-          '#attributes' => array('dir' => 'ltr'),
+          '#attributes' => array('dir' => LanguageInterface::DIRECTION_LTR),
           // Account for the leading backslash.
           '#maxlength' => 254,
         );
-- 
GitLab