class LocaleDefaultConfigStorage (View source)

Provides access to default configuration for locale integration.

Allows unified access to default configuration from one of three sources:

  • Required default configuration (config/install/*)
  • Optional default configuration (config/optional/*)
  • Predefined languages mocked as default configuration (list defined in LocaleConfigManagerInterface::getStandardLanguageList())

These sources are considered equal in terms of how locale module interacts with them for translation. Their translatable source strings are exposed for interface translation and participate in remote translation updates.

Properties

protected StorageInterface $configStorage

The storage instance for reading configuration data.

protected ConfigurableLanguageManagerInterface $languageManager

The language manager.

protected StorageInterface $requiredInstallStorage

The storage instance for reading required default configuration data.

protected StorageInterface $optionalInstallStorage

The storage instance for reading optional default configuration data.

Methods

__construct(StorageInterface $config_storage, ConfigurableLanguageManagerInterface $language_manager, $install_profile)

Constructs a LocaleDefaultConfigStorage.

array
read(string $name)

Read a configuration from install storage or default languages.

array
listAll()

Return the list of configuration in install storage and current languages.

array
getComponentNames(string $type, array $list)

Get all configuration names and folders for a list of modules or themes.

array
predefinedConfiguredLanguages()

Compute the list of configuration names that match predefined languages.

Details

__construct(StorageInterface $config_storage, ConfigurableLanguageManagerInterface $language_manager, $install_profile)

Constructs a LocaleDefaultConfigStorage.

Parameters

StorageInterface $config_storage

The storage object to use for reading configuration data.

ConfigurableLanguageManagerInterface $language_manager

The language manager.

$install_profile

array read(string $name)

Read a configuration from install storage or default languages.

Parameters

string $name

Configuration object name.

Return Value

array

Configuration data from install storage or default language.

array listAll()

Return the list of configuration in install storage and current languages.

Return Value

array

List of configuration in install storage and current languages.

array getComponentNames(string $type, array $list)

Get all configuration names and folders for a list of modules or themes.

Parameters

string $type

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

array $list

Array of theme or module names.

Return Value

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.

protected array predefinedConfiguredLanguages()

Compute the list of configuration names that match predefined languages.

Return Value

array

The list of configuration names that match predefined languages.