Commit 3f689d7a authored by alexpott's avatar alexpott

Issue #2506479 by lauriii, xjm, stefan.r, larowlan, plach, dawehner: Replace...

Issue #2506479 by lauriii, xjm, stefan.r, larowlan, plach, dawehner: Replace !placeholder with @placeholder for non URLs in t() in Views, except for t() output that is used as an attribute value
parent e2f57055
......@@ -185,7 +185,7 @@ public function adminLabel($short = FALSE) {
return $this->options['admin_label'];
}
$title = ($short && isset($this->definition['title short'])) ? $this->definition['title short'] : $this->definition['title'];
return $this->t('!group: !title', array('!group' => $this->definition['group'], '!title' => $title));
return $this->t('@group: @title', array('@group' => $this->definition['group'], '@title' => $title));
}
/**
......
......@@ -585,7 +585,7 @@ protected function listLanguages($flags = LanguageInterface::STATE_ALL, array $c
$name = $types_info[$id]['name'];
// Surround IDs by '***LANGUAGE_...***', to avoid query collisions.
$id = '***LANGUAGE_' . $id . '***';
$list[$id] = $this->t('!type language selected for page', array('!type' => $name));
$list[$id] = $this->t('@type language selected for page', array('@type' => $name));
}
}
if (!empty($current_values)) {
......@@ -595,7 +595,7 @@ protected function listLanguages($flags = LanguageInterface::STATE_ALL, array $c
// add that option too, so it is not lost. If not among the current
// values, skip displaying it to avoid user confusion.
if (isset($type['name']) && !isset($list[$id]) && in_array($id, $current_values)) {
$list[$id] = $this->t('!type language selected for page', array('!type' => $type['name']));
$list[$id] = $this->t('@type language selected for page', array('@type' => $type['name']));
}
}
}
......
......@@ -48,7 +48,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
// Add the HTTP status code, so it's easier for people to find it.
array_walk($options, function($title, $code) use(&$options) {
$options[$code] = $this->t('@code (!title)', array('@code' => $code, '!title' => $title));
$options[$code] = $this->t('@code (@title)', array('@code' => $code, '@title' => $title));
});
$form['status_code'] = array(
......
......@@ -1544,7 +1544,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
if ($access_plugin->usesOptions()) {
$form['markup'] = array(
'#prefix' => '<div class="js-form-item form-item description">',
'#markup' => $this->t('You may also adjust the !settings for the currently selected access restriction.', array('!settings' => $this->optionLink(t('settings'), 'access_options'))),
'#markup' => $this->t('You may also adjust the @settings for the currently selected access restriction.', array('@settings' => $this->optionLink($this->t('settings'), 'access_options'))),
'#suffix' => '</div>',
);
}
......@@ -1582,7 +1582,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected cache mechanism.', array('!settings' => $this->optionLink(t('settings'), 'cache_options'))),
'#markup' => $this->t('You may also adjust the @settings for the currently selected cache mechanism.', array('@settings' => $this->optionLink($this->t('settings'), 'cache_options'))),
);
}
break;
......@@ -1654,7 +1654,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))),
'#markup' => $this->t('You may also adjust the @settings for the currently selected style.', array('@settings' => $this->optionLink($this->t('settings'), 'style_options'))),
);
}
......@@ -1702,7 +1702,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))),
'#markup' => $this->t('You may also adjust the @settings for the currently selected row style.', array('@settings' => $this->optionLink($this->t('settings'), 'row_options'))),
);
}
......@@ -1803,7 +1803,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'exposed_form_options'))),
'#markup' => $this->t('You may also adjust the @settings for the currently selected style.', array('@settings' => $this->optionLink($this->t('settings'), 'exposed_form_options'))),
);
}
break;
......@@ -1839,7 +1839,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected pager.', array('!settings' => $this->optionLink(t('settings'), 'pager_options'))),
'#markup' => $this->t('You may also adjust the @settings for the currently selected pager.', array('@settings' => $this->optionLink($this->t('settings'), 'pager_options'))),
);
}
......
......@@ -37,7 +37,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
'#title' => $this->t('Value type'),
'#options' => array(
'date' => $this->t('A date in any machine readable format. CCYY-MM-DD HH:MM:SS is preferred.'),
'offset' => $this->t('An offset from the current time such as "!example1" or "!example2"', array('!example1' => '+1 day', '!example2' => '-2 hours -30 minutes')),
'offset' => $this->t('An offset from the current time such as "@example1" or "@example2"', array('@example1' => '+1 day', '@example2' => '-2 hours -30 minutes')),
),
'#default_value' => !empty($this->value['type']) ? $this->value['type'] : 'date',
);
......
......@@ -487,7 +487,7 @@ function hook_field_views_data(\Drupal\field\FieldStorageConfigInterface $field_
'id' => 'standard',
'base' => 'file_managed',
'base field' => 'target_id',
'label' => t('image from !field_name', array('!field_name' => $field_storage->getName())),
'label' => t('image from @field_name', array('@field_name' => $field_storage->getName())),
);
}
......@@ -531,7 +531,7 @@ function hook_field_views_data_alter(array &$data, \Drupal\field\FieldStorageCon
'field field' => $field_name . '_target_id',
'base' => $entity_type->getBaseTable(),
'base field' => $entity_type->getKey('id'),
'label' => t('!field_name', array('!field_name' => $field_name)),
'label' => $field_name,
'join_extra' => array(
0 => array(
'field' => 'deleted',
......@@ -588,7 +588,7 @@ function hook_field_views_data_views_data_alter(array &$data, \Drupal\field\Fiel
'field field' => $field_name . '_target_id',
'base' => $entity_type->getBaseTable(),
'base field' => $entity_type->getKey('id'),
'label' => t('!field_name', array('!field_name' => $field_name)),
'label' => $field_name,
'join_extra' => array(
0 => array(
'field' => 'deleted',
......
......@@ -497,12 +497,12 @@ function views_field_default_views_data(FieldStorageConfigInterface $field_stora
}
if (count($field_columns) == 1 || $column == 'value') {
$title = t('@label (!name)', array('@label' => $label, '!name' => $field_name));
$title = t('@label (@name)', array('@label' => $label, '@name' => $field_name));
$title_short = $label;
}
else {
$title = t('@label (!name:!column)', array('@label' => $label, '!name' => $field_name, '!column' => $column));
$title_short = t('@label:!column', array('@label' => $label, '!column' => $column));
$title = t('@label (@name:@column)', array('@label' => $label, '@name' => $field_name, '@column' => $column));
$title_short = t('@label:@column', array('@label' => $label, '@column' => $column));
}
// Expose data for the property.
......@@ -535,10 +535,10 @@ function views_field_default_views_data(FieldStorageConfigInterface $field_stora
foreach ($all_labels as $label_name => $true) {
if ($label != $label_name) {
if (count($field_columns) == 1 || $column == 'value') {
$alias_title = t('@label (!name)', array('@label' => $label_name, '!name' => $field_name));
$alias_title = t('@label (@name)', array('@label' => $label_name, '@name' => $field_name));
}
else {
$alias_title = t('@label (!name:!column)', array('@label' => $label_name, '!name' => $field_name, '!column' => $column));
$alias_title = t('@label (@name:@column)', array('@label' => $label_name, '@name' => $field_name, '@column' => $column));
}
$aliases[] = array(
'group' => $group_name,
......@@ -589,7 +589,7 @@ function views_field_default_views_data(FieldStorageConfigInterface $field_stora
// Expose additional delta column for multiple value fields.
if ($field_storage->isMultiple()) {
$title_delta = t('@label (!name:delta)', array('@label' => $label, '!name' => $field_name));
$title_delta = t('@label (@name:delta)', array('@label' => $label, '@name' => $field_name));
$title_short_delta = t('@label:delta', array('@label' => $label));
$data[$table_alias]['delta'] = array(
......
......@@ -512,6 +512,14 @@ td.group-title {
margin-right: 0.2083em;
}
.views-ui-display-tab-setting > span {
margin-left: 0.5em; /* LTR */
}
[dir="rtl"] .views-ui-display-tab-setting > span {
margin-left: 0;
margin-right: 0.5em;
}
/** Applies an overridden(italics) font style to overridden buckets.
* The better way to implement this would be to add the overridden class
* to the bucket header when the bucket is overridden and style it as a
......
......@@ -139,7 +139,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
foreach ($group_options as $key => $option) {
$form['options']['name'][$key] = array(
'#type' => 'checkbox',
'#title' => $this->t('!group: !field', array('!group' => $option['group'], '!field' => $option['title'])),
'#title' => $this->t('@group: @field', array('@group' => $option['group'], '@field' => $option['title'])),
'#description' => $option['help'],
'#return_value' => $key,
'#prefix' => "<div class='filterable-option'>",
......
......@@ -79,7 +79,7 @@ public function getDescription() {
'#theme' => 'username',
'#account' => $account,
);
return $this->t('By breaking this lock, any unsaved changes made by !user will be lost.', array('!user' => drupal_render($username)));
return $this->t('By breaking this lock, any unsaved changes made by @user will be lost.', array('@user' => drupal_render($username)));
}
/**
......
......@@ -752,14 +752,14 @@ public function renderDisplayTop(ViewUI $view) {
foreach (Views::fetchPluginNames('display', NULL, array($view->get('base_table'))) as $type => $label) {
$element['add_display'][$type] = array(
'#type' => 'submit',
'#value' => $this->t('Add !display', array('!display' => $label)),
'#value' => $this->t('Add @display', array('@display' => $label)),
'#limit_validation_errors' => array(),
'#submit' => array('::submitDisplayAdd', '::submitDelayDestination'),
'#attributes' => array('class' => array('add-display')),
// Allow JavaScript to remove the 'Add ' prefix from the button label when
// placing the button in a "Add" dropdown menu.
'#process' => array_merge(array('views_ui_form_button_was_clicked'), $this->elementInfo->getInfoProperty('submit', '#process', array())),
'#values' => array($this->t('Add !display', array('!display' => $label)), $label),
'#values' => array($this->t('Add @display', array('@display' => $label)), $label),
);
}
......@@ -1130,12 +1130,8 @@ public function getFormBucket(ViewUI $view, $type, $display) {
$last = end($keys);
foreach ($contents as $key => $pid) {
if ($key != $last) {
if ($group_info['groups'][$gid] == 'OR') {
$store[$pid]['#link'] = $this->t('!link &nbsp;&nbsp; OR', ['!link' => $store[$pid]['#link']]);
}
else {
$store[$pid]['#link'] = $this->t('!link &nbsp;&nbsp; AND', ['!link' => $store[$pid]['#link']]);
}
$operator = $group_info['groups'][$gid] == 'OR' ? $this->t('OR') : $this->t('AND');
$store[$pid]['#link'] = SafeMarkup::format('@link <span>@operator</span>', ['@link' => $store[$pid]['#link'], '@operator' => $operator]);
}
$build['fields'][$pid] = $store[$pid];
}
......
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