Issue #1862250 by amanire, Ivan Zugec, Novitsh, joates, sdstyles, yoroy, joshi.rohit100, acabouet, rpayanm, klonos, dahousecat, Daniel_Rose, HeimdallJHM, cluther, vineet.osscube, joachim, Stalski, Bojhan, chris_h: The "Trim length" format description is confusing/not clear to Drupal newcomers

merge-requests/26/head
David Rothstein 2015-10-23 16:44:26 -04:00
parent 12c09ce622
commit 405e86103c
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,8 @@
Drupal 7.42, xxxx-xx-xx (development version) Drupal 7.42, xxxx-xx-xx (development version)
----------------------- -----------------------
- Improved the description of the "Trimmed" format option on text fields
(translatable string change, and minor UI and data structure change).
Drupal 7.41, 2015-10-21 Drupal 7.41, 2015-10-21
----------------------- -----------------------

View File

@ -223,11 +223,13 @@ function text_field_formatter_settings_form($field, $instance, $view_mode, $form
if (strpos($display['type'], '_trimmed') !== FALSE) { if (strpos($display['type'], '_trimmed') !== FALSE) {
$element['trim_length'] = array( $element['trim_length'] = array(
'#title' => t('Trim length'), '#title' => t('Trimmed limit'),
'#type' => 'textfield', '#type' => 'textfield',
'#field_suffix' => t('characters'),
'#size' => 10, '#size' => 10,
'#default_value' => $settings['trim_length'], '#default_value' => $settings['trim_length'],
'#element_validate' => array('element_validate_integer_positive'), '#element_validate' => array('element_validate_integer_positive'),
'#description' => t('If the summary is not set, the trimmed %label field will be shorter than this character limit.', array('%label' => $instance['label'])),
'#required' => TRUE, '#required' => TRUE,
); );
} }
@ -245,7 +247,7 @@ function text_field_formatter_settings_summary($field, $instance, $view_mode) {
$summary = ''; $summary = '';
if (strpos($display['type'], '_trimmed') !== FALSE) { if (strpos($display['type'], '_trimmed') !== FALSE) {
$summary = t('Trim length') . ': ' . check_plain($settings['trim_length']); $summary = t('Trimmed limit: @trim_length characters', array('@trim_length' => $settings['trim_length']));
} }
return $summary; return $summary;