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

8.0.x
webchick 2014-10-09 11:35:43 -07:00
parent cd31649c66
commit 68f7879952
3 changed files with 6 additions and 3 deletions

View File

@ -10,6 +10,7 @@ namespace Drupal\Core\Render\Element;
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 @@ class MachineName extends Textfield {
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'])) {

View File

@ -10,6 +10,7 @@ use Drupal\Component\Utility\Environment;
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),
);
}
}

View File

@ -9,6 +9,7 @@ namespace Drupal\views\Plugin\views\display;
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 @@ abstract class PathPluginBase extends DisplayPluginBase implements DisplayRouter
'#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,
);