LanguageNegotiatorInterface::initializeType

public LanguageNegotiatorInterface::initializeType($type) Initializes the specified language type. Parameters string $type: The language type to be initialized. Return value \Drupal\Core\Language\LanguageInterface[] Returns an array containing a single language keyed by the language negotiation method ID used to determine the language of the specified type. If negotiation is not possible the default language is returned. File core/modules/language/src/LanguageNegotiatorInterface.php, line 131

LanguageNegotiatorInterface::getPrimaryNegotiationMethod

public LanguageNegotiatorInterface::getPrimaryNegotiationMethod($type) Returns the ID of the language type's primary language negotiation method. Parameters string $type: The language type. Return value string The identifier of the primary language negotiation method for the given language type, or the default method if none exists. File core/modules/language/src/LanguageNegotiatorInterface.php, line 165 Class LanguageNegotiatorInterface Common interface for language negotiation services

LanguageNegotiatorInterface::getNegotiationMethods

public LanguageNegotiatorInterface::getNegotiationMethods($type = NULL) Returns the language negotiation methods enabled for a language type. Parameters string $type: (optional) The language type. If no type is specified all the method definitions are returned. Return value array[] An array of language negotiation method definitions keyed by method id. File core/modules/language/src/LanguageNegotiatorInterface.php, line 143 Class LanguageNegotiatorInterface Common interface for language

LanguageNegotiatorInterface::getNegotiationMethodInstance

public LanguageNegotiatorInterface::getNegotiationMethodInstance($method_id) Returns an instance of the specified language negotiation method. Parameters string $method_id: The method identifier. Return value \Drupal\language\LanguageNegotiationMethodInterface File core/modules/language/src/LanguageNegotiatorInterface.php, line 153 Class LanguageNegotiatorInterface Common interface for language negotiation services. Namespace Drupal\language Code public function getNegotiationMethodI

LanguageNegotiatorInterface

Common interface for language negotiation services. The language negotiation API is based on two major concepts: Language types: types of translatable data (the types of data that a user can view or request). Language negotiation methods: responsible for determining which language to use to present a particular piece of data to the user. Both language types and language negotiation methods are customizable. Drupal defines three built-in language types: Interface language: The page's main l

LanguageNegotiator::__construct

public LanguageNegotiator::__construct(ConfigurableLanguageManagerInterface $language_manager, PluginManagerInterface $negotiator_manager, ConfigFactoryInterface $config_factory, Settings $settings, RequestStack $requestStack) Constructs a new LanguageNegotiator object. Parameters \Drupal\language\ConfigurableLanguageManagerInterface $language_manager: The language manager. \Drupal\Component\Plugin\PluginManagerInterface $negotiator_manager: The language negotiation methods plugin manager \Dru

LanguageNegotiator::updateConfiguration

LanguageNegotiator::updateConfiguration(array $types) Updates the configuration based on the given language types. Stores the list of the language types along with information about their configurable state. Stores the default settings if the language type is not configurable. Parameters string[] $types: An array of configurable language types. Overrides LanguageNegotiatorInterface::updateConfiguration File core/modules/language/src/LanguageNegotiator.php, line 292 Class LanguageNegotiator

LanguageNegotiator::setCurrentUser

public LanguageNegotiator::setCurrentUser(AccountInterface $current_user) Sets the current active user and resets all language types. Parameters \Drupal\Core\Session\AccountInterface $current_user: The current active user. Overrides LanguageNegotiatorInterface::setCurrentUser File core/modules/language/src/LanguageNegotiator.php, line 115 Class LanguageNegotiator Class responsible for performing language negotiation. Namespace Drupal\language Code public function setCurrentUser(Accoun

LanguageNegotiator::saveConfiguration

LanguageNegotiator::saveConfiguration($type, $enabled_methods) Saves a list of language negotiation methods for a language type. Parameters string $type: The language type. int[] $enabled_methods: An array of language negotiation method weights keyed by method ID. Overrides LanguageNegotiatorInterface::saveConfiguration File core/modules/language/src/LanguageNegotiator.php, line 248 Class LanguageNegotiator Class responsible for performing language negotiation. Namespace Drupal\languag

LanguageNegotiator::reset

public LanguageNegotiator::reset() Resets the negotiated languages and the method instances. Overrides LanguageNegotiatorInterface::reset File core/modules/language/src/LanguageNegotiator.php, line 107 Class LanguageNegotiator Class responsible for performing language negotiation. Namespace Drupal\language Code public function reset() { $this->negotiatedLanguages = array(); $this->methods = array(); }