Commit 68f78799 authored by webchick's avatar webchick

Issue #2353393 by tstoeckler: Use LanguageInterface::DIRECTION_LTR instead of 'ltr' directly.

parent cd31649c
......@@ -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'])) {
......
......@@ -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),
);
}
}
......
......@@ -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,
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment