Problem/Motivation
LocaleConfigManager (Drupal\\locale\\LocaleConfigManager) manages localized configuration producing some specially wrapped typed configuration data used for translating the configuration through localization system.
It extends atm TypedConfigManager, which means it also reads plug-in information (configuration schema) and produces typed configuration objects instead of reusing plug-in definitions and configuration objects from TypedConfigManager.
This causes some duplication (definitions are read and processed and cached by both managers) while it could very well just reuse the ones in TypedConfiguration Manager, which are the same plugin definitions.
Proposed resolution
Instead of extending it and creating yet another plugin manager, LocaleConfigManager should use the existing TypedConfigManager taking it as a dependency.
Remaining tasks
Review.
User interface changes
None.
API changes
Minimal, internal to locale / configuration translation.
Some LocaleConfigManager methods which were duplicated are replaced by TypedConfigManager ones.
Comment | File | Size | Author |
---|---|---|---|
#4 | 0829-locale-config-manager-04.patch | 15.82 KB | Jose Reyero |
#4 | 0829-interdiff-01-04.txt | 2.77 KB | Jose Reyero |
#1 | 0829-locale-config-manager-01.patch | 13.06 KB | Jose Reyero |
Comments
Comment #1
Jose Reyero CreditAttribution: Jose Reyero commentedPosting first patch and running tests.
Comment #2
Gábor HojtsyMakes sense to me. This also allows swapping out the typed data manager without the need to add a custom implementation of the locale manager as well. Not having two layers with the same data cached / managed is useful.
Comment #4
Jose Reyero CreditAttribution: Jose Reyero commentedUpdated 2 failing tests, which were not in sync with the constructor changes in the patch.
Comment #5
Jose Reyero CreditAttribution: Jose Reyero commentedComment #6
Gábor HojtsyLooks good to me.
Comment #7
alexpottCommitted 2b9631a and pushed to 8.x. Thanks!
Fixed on commit. Unused use and a duplicate line of code.
Comment #9
Gábor HojtsySuperb, thanks!