Problem/Motivation

Locale module uses the word 'component' in both docs and code to mean different things, and most if not all of them are wrong.

Here's a sample:

  /**
   * Get all configuration names and folders for a list of modules or themes.
   *
   * @param string $type
   *   Type of components: 'module' | 'theme' | 'profile'
   * @param array $list
   *   Array of theme or module names.
   *
   * @return array
   *   Configuration names provided by that component. In case of language
   *   module this list is extended with configured languages that have
   *   predefined names as well.
   */
  public function getComponentNames($type, array $list) {

The docblock first line says:

> Get all configuration names

The method returns names of configuration objects. But it's called 'getComponentNames' -- are components configuration objects? I don't think anywhere else calls them that.

The parameter docs says:

> * Type of components: 'module' | 'theme' | 'profile'

and the @return says:

> Configuration names provided by that component

So components are module/theme/profiles?

We're now using the word 'component' to mean two different things!

There are other places in the module that do this too, such as this comment:

      // Update active configuration copies of all prior shipped configuration if
      // they are still English. It is not enough to change configuration shipped
      // with the components just installed, because installing a component such
      // as views may bring in default configuration from prior components.

Steps to reproduce

Proposed resolution

Replace the word 'component' with either:

- 'configuration object' -- this is what the core config component calls them
- 'extension'

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3422955

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

govind_giri_goswami made their first commit to this issue’s fork.

govind_giri_goswami’s picture

Status: Active » Needs review

update comments in core/modules/locale/src/LocaleConfigManager.php file and core/modules/locale/src/LocaleDefaultConfigStorage.php file

mithun s’s picture

Changes looks good. Since we are updating only the text on comments, I don't anticipate regression.
Thank you!

karanpagare’s picture

Status: Needs review » Needs work

I can see more references also in locale.bulk.inc and locale.module which can be changed.

adwivedi008 made their first commit to this issue’s fork.

adwivedi008’s picture

Status: Needs work » Needs review

Worked on #6 as suggested by @karanpagare
Moving the issue to needs review

joachim’s picture

Status: Needs review » Needs work

Looks good so far, but method names such as getComponentNames need changing too.

karanpagare’s picture

Status: Needs work » Needs review

Updated getComponentNames as per #9, can review.

smustgrave’s picture

Status: Needs review » Needs work

This caused test failures, core/modules/locale/src/LocaleConfigManager.php isn't internal so I think changing function names could have BC implications.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.