Issue #1785012 by beltofte, hass, YesCT: Standardize capitalization on actions for node operations: 'revert', 'view', 'edit', 'translate', 'delete'.

8.0.x
Dries 2013-02-14 21:53:23 -05:00
parent 148f3b874e
commit aafa1150d8
11 changed files with 21 additions and 20 deletions

View File

@ -53,7 +53,7 @@ class RevisionLink extends Link {
$this->options['alter']['path'] = $path;
$this->options['alter']['query'] = drupal_get_destination();
return !empty($this->options['text']) ? $this->options['text'] : t('view');
return !empty($this->options['text']) ? $this->options['text'] : t('View');
}
/**

View File

@ -41,7 +41,7 @@ class RevisionLinkDelete extends RevisionLink {
$this->options['alter']['path'] = 'node/' . $node->nid . "/revisions/$vid/delete";
$this->options['alter']['query'] = drupal_get_destination();
return !empty($this->options['text']) ? $this->options['text'] : t('delete');
return !empty($this->options['text']) ? $this->options['text'] : t('Delete');
}
}

View File

@ -41,7 +41,7 @@ class RevisionLinkRevert extends RevisionLink {
$this->options['alter']['path'] = 'node/' . $node->nid . "/revisions/$vid/revert";
$this->options['alter']['query'] = drupal_get_destination();
return !empty($this->options['text']) ? $this->options['text'] : t('revert');
return !empty($this->options['text']) ? $this->options['text'] : t('Revert');
}
}

View File

@ -168,7 +168,7 @@ class NodeTranslationUITest extends EntityTranslationUITest {
// Visit translation page.
$this->drupalGet('node/' . $article->nid . '/translations');
$this->assertRaw('no translatable fields');
$this->assertRaw('No translatable fields');
}
/**

View File

@ -556,21 +556,21 @@ function node_admin_nodes() {
$operations = array();
if (node_access('update', $node)) {
$operations['edit'] = array(
'title' => t('edit'),
'title' => t('Edit'),
'href' => 'node/' . $node->nid . '/edit',
'query' => $destination,
);
}
if (node_access('delete', $node)) {
$operations['delete'] = array(
'title' => t('delete'),
'title' => t('Delete'),
'href' => 'node/' . $node->nid . '/delete',
'query' => $destination,
);
}
if (module_invoke('translation_entity', 'enabled', 'node', $node->bundle())) {
$operations['translate'] = array(
'title' => t('translate'),
'title' => t('Translate'),
'href' => 'node/' . $node->nid . '/translations',
'query' => $destination,
);

View File

@ -275,13 +275,13 @@ function node_revision_overview($node) {
. (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : '');
if ($revert_permission) {
$links['revert'] = array(
'title' => t('revert'),
'title' => t('Revert'),
'href' => "node/$node->nid/revisions/$revision->vid/revert",
);
}
if ($delete_permission) {
$links['delete'] = array(
'title' => t('delete'),
'title' => t('Delete'),
'href' => "node/$node->nid/revisions/$revision->vid/delete",
);
}

View File

@ -72,7 +72,7 @@ class PathLanguageTest extends PathTestBase {
// Translate the node into French.
$this->drupalGet('node/' . $english_node->nid . '/translate');
$this->clickLink(t('add translation'));
$this->clickLink(t('Add translation'));
$edit = array();
$langcode = LANGUAGE_NOT_SPECIFIED;
$edit["title"] = $this->randomName();

View File

@ -81,7 +81,7 @@ class TextTranslationTest extends WebTestBase {
$this->drupalPost('node/add/article', $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($edit['title']);
$this->drupalGet("node/$node->nid/translate");
$this->clickLink(t('add translation'));
$this->clickLink(t('Add translation'));
$this->assertFieldByXPath("//textarea[@name='body[$langcode][0][value]']", $body, 'The textfield widget is populated.');
}
@ -128,7 +128,7 @@ class TextTranslationTest extends WebTestBase {
// Translate the article in french.
$node = $this->drupalGetNodeByTitle($title);
$this->drupalGet("node/$node->nid/translate");
$this->clickLink(t('add translation'));
$this->clickLink(t('Add translation'));
$this->assertNoText($body[0], t('The body field with delta @delta is hidden.', array('@delta' => 0)));
$this->assertText($body[1], t('The body field with delta @delta is shown.', array('@delta' => 1)));
}

View File

@ -70,7 +70,7 @@ function translation_node_overview(Node $node) {
$query = array('query' => array('translation' => $node->nid, 'target' => $langcode));
if (!empty($links->links[$langcode]['href'])) {
$options['add'] = array(
'title' => t('add translation'),
'title' => t('Add translation'),
) + $links->links[$langcode];
$options['add'] = NestedArray::mergeDeep($options['add'], $query);
}

View File

@ -86,7 +86,7 @@ class EntityTranslationWorkflowsTest extends EntityTranslationTestBase {
$this->assertWorkflows($this->administrator, $expected_status);
// Check that translation permissions governate the associated operations.
$ops = array('create' => t('add'), 'update' => t('edit'), 'delete' => t('delete'));
$ops = array('create' => t('Add'), 'update' => t('Edit'), 'delete' => t('Delete'));
$translations_path = $this->controller->getBasePath($this->entity) . "/translations";
foreach ($ops as $current_op => $label) {
$user = $this->drupalCreateUser(array($this->getTranslatePermission(), "$current_op entity translations"));
@ -135,7 +135,7 @@ class EntityTranslationWorkflowsTest extends EntityTranslationTestBase {
// Check whether the user is allowed to create a translation.
$add_translation_path = $translations_path . "/add/$default_langcode/$langcode";
if ($expected_status['add_translation'] == 200) {
$this->clickLink('add');
$this->clickLink('Add');
$this->assertUrl($add_translation_path, $options, 'The translation overview points to the translation form when creating translations.');
// Check that the translation form does not contain shared elements for
// translators.
@ -155,13 +155,14 @@ class EntityTranslationWorkflowsTest extends EntityTranslationTestBase {
if ($expected_status['edit_translation'] == 200) {
$this->drupalGet($translations_path, $options);
$editor = $expected_status['edit'] == 200;
$this->clickLink('edit', intval($editor));
if ($editor) {
$this->clickLink('Edit', 2);
// An editor should be pointed to the entity form in multilingual mode.
$this->assertUrl($edit_path, $options, 'The translation overview points to the edit form for editors when editing translations.');
}
else {
$this->clickLink('Edit');
// While a translator should be pointed to the translation form.
$this->assertUrl($edit_translation_path, $options, 'The translation overview points to the translation form for translators when editing translations.');
// Check that the translation form does not contain shared elements.

View File

@ -93,7 +93,7 @@ function translation_entity_overview(EntityInterface $entity) {
}
if (isset($links['edit'])) {
$links['edit']['title'] = t('edit');
$links['edit']['title'] = t('Edit');
}
$translation = $entity->translation[$langcode];
@ -109,7 +109,7 @@ function translation_entity_overview(EntityInterface $entity) {
$source_name = isset($languages[$source]) ? $languages[$source]->name : t('n/a');
if ($controller->getTranslationAccess($entity, 'delete')) {
$links['delete'] = isset($delete_links->links[$langcode]['href']) ? $delete_links->links[$langcode] : array('href' => $delete_links, 'language' => $language);
$links['delete']['title'] = t('delete');
$links['delete']['title'] = t('Delete');
}
}
}
@ -121,14 +121,14 @@ function translation_entity_overview(EntityInterface $entity) {
if ($source != $langcode && $controller->getTranslationAccess($entity, 'create')) {
if ($translatable) {
$links['add'] = isset($add_links->links[$langcode]['href']) ? $add_links->links[$langcode] : array('href' => $add_path, 'language' => $language);
$links['add']['title'] = t('add');
$links['add']['title'] = t('Add');
}
elseif ($field_ui) {
$entity_path = field_ui_bundle_admin_path($entity->entityType(), $entity->bundle());
// Link directly to the fields tab to make it easier to find the
// setting to enable translation on fields.
$path = $entity_path . '/fields';
$links['nofields'] = array('title' => t('no translatable fields'), 'href' => $path, 'language' => $language);
$links['nofields'] = array('title' => t('No translatable fields'), 'href' => $path, 'language' => $language);
}
}