interface MessageProvider (View source)

Provides localisation of messages

Methods

public
string
translate(string $entity, string $default, array $injection)

Localise this message

public
string
pluralise(string $entity, array|string $default, array $injection, int $count)

Pluralise a message

Details

string translate(string $entity, string $default, array $injection)

Localise this message

Parameters

string $entity

Identifier for this message in Namespace.key format

string $default

Default message

array $injection

List of injection variables

Return Value

string

Localised string

string pluralise(string $entity, array|string $default, array $injection, int $count)

Pluralise a message

Parameters

string $entity

Identifier for this message in Namespace.key format

array|string $default

Default message with pipe-separated delimiters, or array

array $injection

List of injection variables

int $count

Number to pluralise against

Return Value

string

Localised string