LanguageResolver
Resolve language settings for Repository layer.
Methods¶
getPrioritizedLanguages() ¶
Get prioritized languages taking into account forced, context, and configured languages.
|
|
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>
getShowAllTranslations() ¶
Get currently set showAllTranslations.
|
|
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
getUseAlwaysAvailable() ¶
Get currently set UseAlwaysAvailable.
|
|
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
setContextLanguage() ¶
For use by custom events / logic setting language for all retrieved objects from repository.
|
|
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 | - | - |
setDefaultUseAlwaysAvailable() ¶
For use by event listening to config resolver scope changes (or other event changing configured languages).
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$defaultUseAlwaysAvailable | bool | - | - |
setShowAllTranslations() ¶
For use by event listening to config resolver scope changes (or other event changing configured languages).
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$defaultShowAllTranslations | bool | - | - |