Commit 0bad863f authored by pifagor's avatar pifagor Committed by Attila Fekete
Browse files

Issue #2857148 by pifagor, prafull.panchori: t() -> $this->t()

parent d96850e3
......@@ -51,8 +51,8 @@ class SoundCloudDefaultFormatter extends FormatterBase {
$elements = parent::settingsForm($form, $form_state);
$elements['soundcloud_player_type'] = array(
'#title' => t('HTML5 player type'),
'#description' => t('Select which HTML5 player to use.'),
'#title' => $this->t('HTML5 player type'),
'#description' => $this->t('Select which HTML5 player to use.'),
'#type' => 'select',
'#default_value' => $this->getSetting('soundcloud_player_type'),
'#options' => array(
......@@ -63,15 +63,15 @@ class SoundCloudDefaultFormatter extends FormatterBase {
$elements['soundcloud_player_width'] = array(
'#type' => 'textfield',
'#title' => t('Width'),
'#title' => $this->t('Width'),
'#size' => 4,
'#default_value' => $this->getSetting('soundcloud_player_width'),
'#description' => t('Player width in percent. Default is @width.', array('@width' => SOUNDCLOUDFIELD_DEFAULT_WIDTH)),
'#description' => $this->t('Player width in percent. Default is @width.', array('@width' => SOUNDCLOUDFIELD_DEFAULT_WIDTH)),
);
$elements['soundcloud_player_height'] = array(
'#type' => 'textfield',
'#title' => t('Height'),
'#title' => $this->t('Height'),
'#size' => 4,
'#default_value' => $this->getSetting('soundcloud_player_height'),
'#states' => array(
......@@ -83,7 +83,7 @@ class SoundCloudDefaultFormatter extends FormatterBase {
$elements['soundcloud_player_height_sets'] = array(
'#type' => 'textfield',
'#title' => t('Height for sets'),
'#title' => $this->t('Height for sets'),
'#size' => 4,
'#default_value' => $this->getSetting('soundcloud_player_height_sets'),
'#states' => array(
......@@ -95,7 +95,7 @@ class SoundCloudDefaultFormatter extends FormatterBase {
$elements['soundcloud_player_visual_height'] = array(
'#type' => 'select',
'#title' => t('Height of the visual player'),
'#title' => $this->t('Height of the visual player'),
'#size' => 4,
'#default_value' => $this->getSetting('soundcloud_player_visual_height'),
'#options' => array(
......@@ -112,38 +112,38 @@ class SoundCloudDefaultFormatter extends FormatterBase {
$elements['soundcloud_player_autoplay'] = array(
'#type' => 'checkbox',
'#title' => t('Play audio automatically when loaded (autoplay).'),
'#title' => $this->t('Play audio automatically when loaded (autoplay).'),
'#default_value' => $this->getSetting('soundcloud_player_autoplay'),
);
$elements['soundcloud_player_color'] = array(
'#type' => 'textfield',
'#title' => t('Player color.'),
'#title' => $this->t('Player color.'),
'#default_value' => $this->getSetting('soundcloud_player_color'),
'#description' => t('Player color in hexadecimal format. Default is ff7700. Turn on the jQuery Colorpicker module if available.'),
'#description' => $this->t('Player color in hexadecimal format. Default is ff7700. Turn on the jQuery Colorpicker module if available.'),
);
$elements['soundcloud_player_hiderelated'] = array(
'#type' => 'checkbox',
'#title' => t('Hide raleted tracks.'),
'#title' => $this->t('Hide raleted tracks.'),
'#default_value' => $this->getSetting('soundcloud_player_hiderelated'),
);
$elements['soundcloud_player_showartwork'] = array(
'#type' => 'checkbox',
'#title' => t('Show artwork.'),
'#title' => $this->t('Show artwork.'),
'#default_value' => $this->getSetting('soundcloud_player_showartwork'),
);
$elements['soundcloud_player_showcomments'] = array(
'#type' => 'checkbox',
'#title' => t('Show comments.'),
'#title' => $this->t('Show comments.'),
'#default_value' => $this->getSetting('soundcloud_player_showcomments'),
);
$elements['soundcloud_player_showplaycount'] = array(
'#type' => 'checkbox',
'#title' => t('Show play count.'),
'#title' => $this->t('Show play count.'),
'#default_value' => $this->getSetting('soundcloud_player_showplaycount'),
);
......@@ -157,7 +157,7 @@ class SoundCloudDefaultFormatter extends FormatterBase {
$summary = array();
$settings = $this->getSettings();
$summary[] = t('Displays the SoundCloud player.');
$summary[] = $this->t('Displays the SoundCloud player.');
return $summary;
}
......@@ -262,7 +262,7 @@ class SoundCloudDefaultFormatter extends FormatterBase {
$output = html_entity_decode($final_iframe);
}
else {
$output = t('The SoundCloud content at !url is not available, or it is set to private.', array('!url' => l($item['url'], $item['url'])));
$output = $this->t('The SoundCloud content at !url is not available, or it is set to private.', array('!url' => l($item['url'], $item['url'])));
}
// Extract field item attributes for the theme function, and unset them
......
......@@ -47,23 +47,23 @@ class SoundCloudLinkFormatter extends FormatterBase {
$elements['trim_length'] = array(
'#type' => 'number',
'#title' => t('Trim link text length'),
'#field_suffix' => t('characters'),
'#title' => $this->t('Trim link text length'),
'#field_suffix' => $this->t('characters'),
'#default_value' => $this->getSetting('trim_length'),
'#min' => 1,
'#description' => t('Leave blank to allow unlimited link text lengths.'),
'#description' => $this->t('Leave blank to allow unlimited link text lengths.'),
);
$elements['rel'] = array(
'#type' => 'checkbox',
'#title' => t('Add rel="nofollow" to links'),
'#title' => $this->t('Add rel="nofollow" to links'),
'#return_value' => 'nofollow',
'#default_value' => $this->getSetting('rel'),
);
$elements['target'] = array(
'#type' => 'checkbox',
'#title' => t('Open link in new window'),
'#title' => $this->t('Open link in new window'),
'#return_value' => '_blank',
'#default_value' => $this->getSetting('target'),
);
......@@ -78,20 +78,20 @@ class SoundCloudLinkFormatter extends FormatterBase {
$summary = array();
$settings = $this->getSettings();
$summary[] = t('Displays the SoundCloud link.');
$summary[] = $this->t('Displays the SoundCloud link.');
if (!empty($settings['trim_length'])) {
$summary[] = t('Link text trimmed to @limit characters', array('@limit' => $settings['trim_length']));
$summary[] = $this->t('Link text trimmed to @limit characters', array('@limit' => $settings['trim_length']));
}
else {
$summary[] = t('Link text not trimmed');
$summary[] = $this->t('Link text not trimmed');
}
if (!empty($settings['rel'])) {
$summary[] = t('Add rel="@rel"', array('@rel' => $settings['rel']));
$summary[] = $this->t('Add rel="@rel"', array('@rel' => $settings['rel']));
}
if (!empty($settings['target'])) {
$summary[] = t('Open link in new window');
$summary[] = $this->t('Open link in new window');
}
return $summary;
......
......@@ -84,7 +84,7 @@ class SoundCloudItem extends FieldItemBase {
'url' => array(
'Length' => array(
'max' => $max_length,
'maxMessage' => t('%name: the SoundCloud URL may not be longer than @max characters.', array('%name' => $this->getFieldDefinition()->getLabel(), '@max' => $max_length)),
'maxMessage' => $this->t('%name: the SoundCloud URL may not be longer than @max characters.', array('%name' => $this->getFieldDefinition()->getLabel(), '@max' => $max_length)),
)
),
));
......
......@@ -48,7 +48,7 @@ class SoundCloudWidget extends WidgetBase {
// Build the element render array.
$element['url'] = array(
'#type' => 'url', // investigate, other types? (textfield)
'#title' => t('SoundCloud URL'),
'#title' => $this->t('SoundCloud URL'),
'#placeholder' => $this->getSetting('placeholder_url'), // investigate
'#default_value' => isset($item->url) ? $item->url : NULL,
'#element_validate' => array(array(get_called_class(), 'validateSoundCloudUriElement')),
......@@ -73,9 +73,9 @@ class SoundCloudWidget extends WidgetBase {
$elements['placeholder_url'] = array(
'#type' => 'textfield',
'#title' => t('Placeholder for URL'),
'#title' => $this->t('Placeholder for URL'),
'#default_value' => $this->getSetting('placeholder_url'),
'#description' => t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
'#description' => $this->t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
);
return $elements;
......@@ -89,11 +89,11 @@ class SoundCloudWidget extends WidgetBase {
$placeholder_url = $this->getSetting('placeholder_url');
if (empty($placeholder_url)) {
$summary[] = t('No placeholders');
$summary[] = $this->t('No placeholders');
}
else {
if (!empty($placeholder_url)) {
$summary[] = t('URL placeholder: @placeholder_url', array('@placeholder_url' => $placeholder_url));
$summary[] = $this->t('URL placeholder: @placeholder_url', array('@placeholder_url' => $placeholder_url));
}
}
......
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