Copied!

LanguageResolver

LanguageResolver.php : 14

Resolve language settings for Repository layer.

Methods

publicgetPrioritizedLanguages()

LanguageResolver.php : 35

Get prioritized languages taking into account forced, context, and configured languages.

public getPrioritizedLanguages([array<string|int, mixed>|null $forcedLanguages = null ]) : array<string|int, string>

Parameters

Name Type Default value Description
$forcedLanguages array<string|int, mixed>|null null

Optional, typically arguments provided to API, will be used first if set.

Return values

array<string|int, string>

publicgetShowAllTranslations()

LanguageResolver.php : 55

Get currently set showAllTranslations.

public getShowAllTranslations([bool|null $forcedShowAllTranslations = null ]) : bool

Parameters

Name Type Default value Description
$forcedShowAllTranslations bool|null null

Optional, if set will be used instead of configured value, typically arguments provided to API.

Return values

bool

publicgetUseAlwaysAvailable()

LanguageResolver.php : 45

Get currently set UseAlwaysAvailable.

public getUseAlwaysAvailable([bool|null $forcedUseAlwaysAvailable = null ]) : bool

Parameters

Name Type Default value Description
$forcedUseAlwaysAvailable bool|null null

Optional, if set will be used instead of configured value, typically arguments provided to API.

Return values

bool

publicsetContextLanguage()

LanguageResolver.php : 26

For use by custom events / logic setting language for all retrieved objects from repository.

public setContextLanguage(string|null $contextLanguage) : void

If set, user (context) language will be prepended to a list of configured prioritized languages.

Languages forced by PHP API consumer when retrieving Repository objects will still take priority, setting both context language and prioritized languages list as a fallback.

Parameters

Name Type Default value Description
$contextLanguage string|null - -

publicsetDefaultUseAlwaysAvailable()

LanguageResolver.php : 69

For use by event listening to config resolver scope changes (or other event changing configured languages).

public setDefaultUseAlwaysAvailable(bool $defaultUseAlwaysAvailable) : void

Parameters

Name Type Default value Description
$defaultUseAlwaysAvailable bool - -

publicsetShowAllTranslations()

LanguageResolver.php : 62

For use by event listening to config resolver scope changes (or other event changing configured languages).

public setShowAllTranslations(bool $defaultShowAllTranslations) : void

Parameters

Name Type Default value Description
$defaultShowAllTranslations bool - -