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
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
Comment #4
govind_giri_goswami commentedupdate comments in core/modules/locale/src/LocaleConfigManager.php file and core/modules/locale/src/LocaleDefaultConfigStorage.php file
Comment #5
mithun sChanges looks good. Since we are updating only the text on comments, I don't anticipate regression.
Thank you!
Comment #6
karanpagare commentedI can see more references also in locale.bulk.inc and locale.module which can be changed.
Comment #8
adwivedi008 commentedWorked on #6 as suggested by @karanpagare
Moving the issue to needs review
Comment #9
joachim commentedLooks good so far, but method names such as getComponentNames need changing too.
Comment #10
karanpagare commentedUpdated getComponentNames as per #9, can review.
Comment #11
smustgrave commentedThis caused test failures, core/modules/locale/src/LocaleConfigManager.php isn't internal so I think changing function names could have BC implications.