class I18nSubscriber implements EventSubscriberInterface

Class I18nSubscriber

Properties

array $originalLang Used for rolling back language to its original setting after the api call.

Methods

static array
getSubscribedEvents()

No description

onApiPrepare(Event $event)

Support multi-lingual requests

onApiRespond(Event $event)

Reset language to the default.

setLocale(string $lcMessages, int $requestId)

Sets the tsLocale and dbLocale for multi-lingual sites.

Details

at line 49
static array getSubscribedEvents()

Return Value

array

at line 64
onApiPrepare(Event $event)

Support multi-lingual requests

Parameters

Event $event API preparation event.

Exceptions

API_Exception

at line 86
onApiRespond(Event $event)

Reset language to the default.

Parameters

Event $event

Exceptions

API_Exception

at line 105
setLocale(string $lcMessages, int $requestId)

Sets the tsLocale and dbLocale for multi-lingual sites.

Some code duplication from CRM/Core/BAO/ConfigSetting.php retrieve() to avoid regressions from refactoring.

Parameters

string $lcMessages
int $requestId

Exceptions

API_Exception