LanguageManagerInterface
interface LanguageManagerInterface (View source)
Common interface for the language manager service.
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.
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.