ConfigurableLanguageManagerInterface
interface ConfigurableLanguageManagerInterface implements LanguageManagerInterface (View source)
Common interface for language negotiation services.
Methods
Returns whether or not the site has more than one language added.
Returns an array of the available language types.
Returns information about all defined language types.
Returns the current language for the given type.
Resets the given language type or all types if none specified.
Returns a language object representing the site's default language.
Returns a list of languages set up on the site.
Returns a list of languages set up on the site in their native form.
Returns a language object from the given language code.
Produced the printed name for a language for display.
Returns a list of the default locked languages.
Checks whether a language is locked.
Returns the language fallback candidates for a given context.
Returns the language switch links for the given language type.
Sets the configuration override language.
Gets the current configuration override language.
Some common languages with their English and native names.
Rebuild the container to register services needed on multilingual sites.
Returns the language negotiator.
Returns all the defined language types including fixed ones.
Stores language types configuration.
Updates locked system language weights.
Gets a language config override object.
Gets a language configuration override storage object.
Returns the standard language list excluding already configured languages.
Gets the negotiated language method ID.
Details
bool
isMultilingual()
Returns whether or not the site has more than one language added.
array
getLanguageTypes()
Returns an array of the available language types.
array
getDefinedLanguageTypesInfo()
Returns information about all defined language types.
LanguageInterface
getCurrentLanguage(string $type = LanguageInterface::TYPE_INTERFACE)
Returns the current language for the given type.
$this
reset(string|null $type = NULL)
Resets the given language type or all types if none specified.
LanguageInterface
getDefaultLanguage()
Returns a language object representing the site's default language.
LanguageInterface[]
getLanguages(int $flags = LanguageInterface::STATE_CONFIGURABLE)
Returns a list of languages set up on the site.
LanguageInterface[]
getNativeLanguages()
Returns a list of languages set up on the site in their native form.
LanguageInterface|null
getLanguage(string $langcode)
Returns a language object from the given language code.
string
getLanguageName(string $langcode)
Produced the printed name for a language for display.
LanguageInterface[]
getDefaultLockedLanguages(int $weight = 0)
Returns a list of the default locked languages.
bool
isLanguageLocked(string $langcode)
Checks whether a language is locked.
array
getFallbackCandidates(array $context = [])
Returns the language fallback candidates for a given context.
array
getLanguageSwitchLinks(string $type, Url $url)
Returns the language switch links for the given language type.
$this
setConfigOverrideLanguage(LanguageInterface $language = NULL)
Sets the configuration override language.
LanguageInterface
getConfigOverrideLanguage()
Gets the current configuration override language.
static array
getStandardLanguageList()
Some common languages with their English and native names.
Language codes are defined by the W3C language tags document for interoperability. Language codes typically have a language and, optionally, a script or regional variant name. See: http://www.w3.org/International/articles/language-tags/ for more information.
static
rebuildServices()
Rebuild the container to register services needed on multilingual sites.
LanguageNegotiatorInterface
getNegotiator()
Returns the language negotiator.
setNegotiator(LanguageNegotiatorInterface $negotiator)
Injects the language negotiator.
array
getDefinedLanguageTypes()
Returns all the defined language types including fixed ones.
A language type maybe configurable or fixed. A fixed language type is a type whose language negotiation methods are module-defined and not altered through the user interface.
saveLanguageTypesConfiguration(array $config)
Stores language types configuration.
updateLockedLanguageWeights()
Updates locked system language weights.
LanguageConfigOverride
getLanguageConfigOverride(string $langcode, string $name)
Gets a language config override object.
StorageInterface
getLanguageConfigOverrideStorage(string $langcode)
Gets a language configuration override storage object.
array
getStandardLanguageListWithoutConfigured()
Returns the standard language list excluding already configured languages.
string|null
getNegotiatedLanguageMethod(string $type = LanguageInterface::TYPE_INTERFACE)
Gets the negotiated language method ID.