Need to replace the word e.g. with "for example" or "for instance" and i.e. with "that is" English literals in the in /core/scripts, /core/tests & /core/themes directories

Note: Frequently, the replacement of text with 'for instance' or 'for example' requires the re-wrapping of docblocks and code comments to be near but less than 80 characters.

Comments

Lars Toomre created an issue. See original summary.

lars toomre’s picture

Here is an initial patch for this round. It covers all of the 'e.g.' strings in core/modules/[l-m]*.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks! Mostly great! A few small things to fix...

  1. +++ b/core/modules/language/language.module
    @@ -73,13 +73,13 @@ function language_help($route_name, RouteMatchInterface $route_match) {
    -      $output = '<p>' . t('Changing the selected language here (and leaving this option as the last among the detection and selection options) is the easiest way to change the fallback language for the website, if you need to change how your site works by default (e.g., when using an empty path prefix or using the default domain). <a href=":admin-change-language">Changing the site\'s default language</a> itself might have other undesired side effects.', array(':admin-change-language' => \Drupal::url('entity.configurable_language.collection'))) . '</p>';
    +      $output = '<p>' . t('Changing the selected language here (and leaving this option as the last among the detection and selection options) is the easiest way to change the fallback language for the website, if you need to change how your site works by default (for example, when using an empty path prefix or using the default domain). <a href=":admin-change-language">Changing the site\'s default language</a> itself might have other undesired side effects.', array(':admin-change-language' => \Drupal::url('entity.configurable_language.collection'))) . '</p>';
           return $output;
    

    Please let us not have translatable strings in this patch. It complicates being able to commit these documentation patches to particular versions of Drupal, and these changes are not really bugs per se, enough to invalidate translations for the 160+ languages on localize.drupal.org, just because we don't like "e.g." much.

  2. +++ b/core/modules/locale/locale.module
    @@ -258,19 +258,19 @@ function locale_translatable_language_list() {
    - * @param $count
    + * @param int $count
      *   Number to return plural for.
    

    I am not convinced that this is always an integer or has to be.

  3. +++ b/core/modules/locale/locale.module
    @@ -905,19 +921,20 @@ function locale_translation_get_status($projects = NULL, $langcodes = NULL) {
    - *   File object also containing timestamp when the translation is last updated.
    + *   The file object also containing timestamp when the translation is last
    + *   updated.
    

    If you're going to fix this line... could be fixed even more. Needs additional "the" here and there, and "is" should be "was" I think?

  4. +++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php
    @@ -147,18 +147,19 @@ protected function makePoFile($path, $filename, $timestamp = NULL, array $transl
    +   * Normally remote files are located at a remote server (for example,
    +   * ftp.drupal.org).    * For testing we can not rely on this. A directory in
    

    Oops. Stray * on this line from rewrap.

  5. +++ b/core/modules/migrate/src/Plugin/migrate/process/Flatten.php
    @@ -3,35 +3,49 @@
    +   *   The migrate executable object. This variable is not used in this method.
    +   * @param \Drupal\migrate\Row $row
    +   *   This variable is not used in this method.
    +   * @param mixed $destination_property
    +   *   This variable is not used in this method.
    

    I would not call the parameters "variables" here. I think "parameter" would be better?

  6. +++ b/core/modules/migrate/src/Plugin/migrate/process/Flatten.php
    @@ -3,35 +3,49 @@
    +   * @return array
    +   *   An array containing the elements of the iterator.
    

    Um, what iterator? The one-line doc says this just flattens arrays. ???

  7. +++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
    @@ -141,18 +145,18 @@ class TestDrupal6SqlBase extends DrupalSqlBase {
    -      'name' => t('The name of the item; e.g. node.'),
    +      'name' => t('The name of the item; for example, node.'),
    

    We don't want to change translatable strings in this patch.

  8. +++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
    @@ -141,18 +145,18 @@ class TestDrupal6SqlBase extends DrupalSqlBase {
    -      'bootstrap' => t('Boolean indicating whether this module is loaded during Drupal\'s early bootstrapping phase (e.g. even before the page cache is consulted).'),
    +      'bootstrap' => t('Boolean indicating whether this module is loaded during Drupal\'s early bootstrapping phase (for example, even before the page cache is consulted).'),
    

    translatable string change

jhodgdon’s picture

Also... As per discussion on that other issue... We need to limit the scope of this issue to only e.g. and i.e. fixes, and take out all the other fixes.

imalabya’s picture

Version: 8.0.x-dev » 8.2.x-dev
StatusFileSize
new25.57 KB

There are 500+ instances of e.g. & i.e.
Have added a patch for core/includes against 8.2.x branch.
Will be adding subsequent patches for other instances.

imalabya’s picture

@jhodgdon should i change the status to Needs Review for bot test as the patch doesn't cover all the instances

imalabya’s picture

IMO the titles of all the related issues should be renamed based on targeting the fix ranges. Like we can use this to fix the changes in core/includes folder.

What are your thoughts @jeniffer?

jhodgdon’s picture

Take a look at the patch/comment in #2. This issue should be for core/modules/[l-m]* and a separate issue should be made for core/includes.

I agree that the titles should say which files they target. And the issue summaries.

jhodgdon’s picture

Also there should be a parent issue with title like:

[meta] Replace i.e. and e.g. with English words

And all of the related issues should be marked as having that one as Parent issue (in their Issue summary and Relationships section).

If you'd like to fix up all the issue titles and make a parent Meta issue, that would be wonderful. Thanks! Right now all you can do is follow Related from round 6 to 5 to 4 etc. They all should have a parent issue.

imalabya’s picture

imalabya’s picture

Title: Some fixes for 'e.g.' in docblocks and code comments - Round 6 » Replace i.e. and e.g. with English words in /core/scripts, /core/tests & /core/themes directories
Issue summary: View changes
girish-jerk’s picture

Assigned: Unassigned » girish-jerk
jhodgdon’s picture

I just reviewed a patch made by someone else on a different issue. Please read the comment at #2640718-12: Replace i.e. and e.g. with English words in core/modules A-L before you make a patch here. It may be helpful. Thanks!

girish-jerk’s picture

Status: Needs work » Needs review
Issue tags: +ChennaiSprintWeekend
StatusFileSize
new39.59 KB

Hi,
I have created a patch for #11 by replacing i.e. and e.g. with English words.

imalabya’s picture

Status: Needs review » Needs work
+++ b/core/scripts/drupal.sh
@@ -34,14 +34,14 @@
+  URI         The URI to execute, that is http://default/foo/bar for executing

#2640718-12: Replace i.e. and e.g. with English words in core/modules A-L is not addressed here.

i.e should be replaced with correct punctuation
which is - "that is,"

  1. +++ b/core/scripts/drupal.sh
    @@ -34,14 +34,14 @@
    +              that is if URI is set to http://default/bar/foo.php
    

    same here.
    Also I think it should be for example

  2. +++ b/core/scripts/run-tests.sh
    @@ -166,7 +166,7 @@ function simpletest_script_help() {
    +  --url       The base URL of the root directory of this Drupal checkout; for example:
    

    needs line wrapping

  3. +++ b/core/scripts/run-tests.sh
    @@ -178,7 +178,7 @@ function simpletest_script_help() {
    +              sub-processes. However, you may use for example '/tmpfs/test.sqlite'
    

    line wrapping and punctuation

  4. +++ b/core/scripts/run-tests.sh
    @@ -206,13 +206,13 @@ function simpletest_script_help() {
    +              (that is 'core/modules/user/user.test').
    

    punctuation issue here

  5. +++ b/core/scripts/run-tests.sh
    @@ -206,13 +206,13 @@ function simpletest_script_help() {
    +              (that is --types "Simpletest,PHPUnit-Functional")
    

    punctuation issue

  6. +++ b/core/scripts/run-tests.sh
    @@ -455,8 +455,8 @@ function simpletest_script_init() {
    + *   connection uses for example SQLite, then all tests will run against SQLite. This
    

    Line wrapping

  7. +++ b/core/scripts/run-tests.sh
    @@ -477,7 +477,7 @@ function simpletest_script_setup_database($new = FALSE) {
    +  // against for example MySQL instead of SQLite.
    

    Punctuation issue. Also the documents needs to be rephrased. Not making much sense.

  8. +++ b/core/scripts/run-tests.sh
    @@ -794,14 +794,14 @@ function simpletest_script_command($test_id, $test_class) {
    + * In case a (for example, fatal) error occurs after the test site has been fully setup
    

    Line wrapping.
    Can be written as
    "In case a error occurs like fatal,.."

Haven't checked further. The issues are repetitive.
Also please check the documents and read it carefully an replace accordingly. There are instances where writer may have used e.g. but it needs i.e. or vice versa. please check #2640718-12: Replace i.e. and e.g. with English words in core/modules A-L for more information on how to proceed.

jhodgdon’s picture

Clarification: generally the punctuation needs to also have a semicolon in it. Like this:

All of the cats need to be put inside; for example, the red cat and the blue cat.
The cats need to be put inside; that is, they cannot be left outside.

That is the correct punctuation when you are joining two clauses with for example or that is. Sometimes "for example" is also inserted as an aside, like this, and in that case you use a comma not semicolon:

Cats are usually smaller than dogs. Blue cats, for example, weigh just 10 pounds.

imalabya’s picture

Status: Needs work » Needs review
StatusFileSize
new32.62 KB

Added a new patch.

jhodgdon’s picture

On #2637336-33: Replace i.e. and e.g. with English words in /core/includes and /core/misc directory, catch pointed out that we need a Coder/DrupalCS rule before any of these issues can be committed. See
https://www.drupal.org/core/scope#coding-standards

So I will delay reviewing any more on these issues until that is done.

jhodgdon’s picture

Status: Needs review » Closed (won't fix)

This series of issues is badly scoped. I am just going to close them. Sorry.