diff --git a/core/modules/views/config/schema/views.data_types.schema.yml b/core/modules/views/config/schema/views.data_types.schema.yml index 79694affa096784ceec81af517b47185eeffce16..1a02c0032d0cd53bb14bd7a2880416b195ab845d 100644 --- a/core/modules/views/config/schema/views.data_types.schema.yml +++ b/core/modules/views/config/schema/views.data_types.schema.yml @@ -516,7 +516,7 @@ views_field: label: 'Trim only on a word boundary' ellipsis: type: boolean - label: 'Add "..." at the end of trimmed text' + label: 'Add "…" at the end of trimmed text' more_link: type: boolean label: 'Add a read-more link if output is trimmed.' diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index 565a53c5b796853a321dfdc7e4d5eae493e4a38c..704a838a427c2e96d5b0531ef0ac49952007b6aa 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -946,7 +946,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['alter']['ellipsis'] = array( '#type' => 'checkbox', - '#title' => t('Add "..." at the end of trimmed text'), + '#title' => t('Add "…" at the end of trimmed text'), '#default_value' => $this->options['alter']['ellipsis'], '#states' => array( 'visible' => array( @@ -1655,7 +1655,7 @@ public function adminLabel($short = FALSE) { * The alter array of options to use. * - max_length: Maximum length of the string, the rest gets truncated. * - word_boundary: Trim only on a word boundary. - * - ellipsis: Show an ellipsis (...) at the end of the trimmed string. + * - ellipsis: Show an ellipsis (…) at the end of the trimmed string. * - html: Make sure that the html is correct. * * @param string $value @@ -1684,8 +1684,7 @@ public static function trimText($alter, $value) { $value = rtrim(preg_replace('/(?:<(?!.+>)|&(?!.+;)).*$/us', '', $value)); if (!empty($alter['ellipsis'])) { - // @todo: What about changing this to a real ellipsis? - $value .= t('...'); + $value .= t('…'); } } if (!empty($alter['html'])) { diff --git a/core/modules/views/src/Plugin/views/filter/InOperator.php b/core/modules/views/src/Plugin/views/filter/InOperator.php index 6c546504f2f33a5bffd7252e150b66c35e8aab7a..1902b3bf0af44375461d6cf461d76b5e6dca9e43 100644 --- a/core/modules/views/src/Plugin/views/filter/InOperator.php +++ b/core/modules/views/src/Plugin/views/filter/InOperator.php @@ -8,6 +8,7 @@ namespace Drupal\views\Plugin\views\filter; use Drupal\Component\Utility\String as UtilityString; +use Drupal\Component\Utility\Unicode; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ViewExecutable; @@ -356,7 +357,7 @@ public function adminSummary() { $values .= ', '; } if (drupal_strlen($values) > 8) { - $values .= '...'; + $values = Unicode::truncate($values, 8, FALSE, TRUE); break; } if (isset($this->value_options[$value])) { diff --git a/core/modules/views/src/Tests/Handler/FieldWebTest.php b/core/modules/views/src/Tests/Handler/FieldWebTest.php index d4b178136da11b4ac7fb3856d6858d87b42f6133..3afbadb7e37aa6d90a7d725e66560463db9f5701 100644 --- a/core/modules/views/src/Tests/Handler/FieldWebTest.php +++ b/core/modules/views/src/Tests/Handler/FieldWebTest.php @@ -559,10 +559,10 @@ public function testTextRendering() { $row->views_test_data_name = $this->randomName(8); $name_field->options['alter']['max_length'] = 5; $output = $name_field->advancedRender($row); - $this->assertSubString($output, '...', 'An ellipsis should appear if the output is trimmed'); + $this->assertSubString($output, '…', 'An ellipsis should appear if the output is trimmed'); $name_field->options['alter']['max_length'] = 10; $output = $name_field->advancedRender($row); - $this->assertNotSubString($output, '...', 'No ellipsis should appear if the output is not trimmed'); + $this->assertNotSubString($output, '…', 'No ellipsis should appear if the output is not trimmed'); } }