trait LanguageConfigCollectionNameTrait (View source)

Provides a common trait for working with language override collection names.

Methods

string
createConfigCollectionName(string $langcode)

Creates a configuration collection name based on a language code.

string
getLangcodeFromCollectionName(string $collection)

Converts a configuration collection name to a language code.

Details

protected string createConfigCollectionName(string $langcode)

Creates a configuration collection name based on a language code.

Parameters

string $langcode

The language code.

Return Value

string

The configuration collection name for a language code.

protected string getLangcodeFromCollectionName(string $collection)

Converts a configuration collection name to a language code.

Parameters

string $collection

The configuration collection name.

Return Value

string

The language code of the collection.

Exceptions

InvalidArgumentException

See also

\Drupal\language\Config\self::createConfigCollectionName()