API page: https://api.drupal.org/api/drupal/core%21includes%21entity.inc/function/...

In this API documentation block, as well as many others in Drupal core, I keep seeing people write "... associated to..." rather than "associated with".

Could we possibly fix this?

A quick grep for "associated to" in the core directory finds 23 instances. There might be others outside of "core". Don't fix "vendor".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon created an issue. See original summary.

Pravin Ajaaz’s picture

There are about 20 "associated to" ignoring the vendor files. Here is the patch to fix it.

Pravin Ajaaz’s picture

Status: Active » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

Looks pretty good, thanks!

A few small things to fix:

  1. +++ b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
    @@ -46,7 +46,7 @@ class EntityViewDisplay extends EntityDisplayBase implements EntityViewDisplayIn
    -   * be either the display object associated to the view mode, or the 'default'
    +   * be either the display object associated with the view mode, or the 'default'
        * display.
        *
    

    The comment line is now over 80 characters, so it needs to be rewrapped.

  2. +++ b/core/misc/states.js
    @@ -442,7 +442,7 @@
    -        // The function associated to that trigger returns the new value for the
    +        // The function associated with that trigger returns the new value for the
             // state.
             return this.val() === '';
    

    Needs wrapping to 80 characters too.

  3. +++ b/core/modules/menu_ui/src/Tests/MenuTest.php
    @@ -243,9 +243,9 @@ function deleteCustomMenu() {
    -    // Test if all menu links associated to the menu were removed from database.
    +    // Test if all menu links associated with the menu were removed from database.
         $result = entity_load_multiple_by_properties('menu_link_content', array('menu_name' => $menu_name));
    

    Another rewrap needed here.

  4. +++ b/core/modules/shortcut/src/Controller/ShortcutController.php
    @@ -18,7 +18,7 @@
       /**
    -   * Returns a rendered edit form to create a new shortcut associated to the
    +   * Returns a rendered edit form to create a new shortcut associated with the
        * given shortcut set.
        *
    

    This problem didn't come from the patch, but the first line docs for a method should be one line not two lines.

    So maybe change this to:

    Returns a form to add a new shortcut to a given set.

    (I doubt it is rendered!)

  5. +++ b/core/modules/taxonomy/src/Controller/TaxonomyController.php
    @@ -32,7 +32,7 @@ public function getTitle(TermInterface $term) {
       /**
    -   * Returns a rendered edit form to create a new term associated to the given vocabulary.
    +   * Returns a rendered edit form to create a new term associated with the given vocabulary.
        *
    

    This is also too long. It needs to be one line only, and less than 80 characters...

    Maybe:

    Returns a form to add a new term to a vocabulary.

  6. +++ b/core/modules/views/src/Plugin/views/style/Table.php
    @@ -232,7 +232,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    -      '#description' => $this->t('A title which is semantically associated to your table for increased accessibility.'),
    +      '#description' => $this->t('A title which is semantically associated with your table for increased accessibility.'),
           '#default_value' => $this->options['caption'],
    

    Again, not due to this patch, but for better grammar, we should delete "which is" from this description line.

Pravin Ajaaz’s picture

Thanks for the detailed review Jennifer :) I have updated the patch based on your suggestions.

Pravin Ajaaz’s picture

Status: Needs work » Needs review
Pravin Ajaaz’s picture

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 026e9d8 and pushed to 8.0.x. Thanks!

diff --git a/core/misc/states.js b/core/misc/states.js
index 8726c57..c10e306 100644
--- a/core/misc/states.js
+++ b/core/misc/states.js
@@ -442,8 +442,8 @@
     empty: {
       // 'keyup' is the (native DOM) event that we watch for.
       keyup: function () {
-        // The function associated with that trigger returns the new value
-        // for the state.
+        // The function associated with that trigger returns the new value for
+        // the state.
         return this.val() === '';
       }
     },

Fixed 80 cols on commit.

  • alexpott committed 026e9d8 on 8.0.x
    Issue #2549091 by Pravin Ajaaz, jhodgdon: Fix "associated to" ==> "...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.