\Aura\IntlPackage

Message Catalog

Summary

Methods
Properties
Constants
__construct()
setMessages()
addMessage()
addMessages()
getMessages()
getMessage()
setFormatter()
getFormatter()
setFallback()
getFallback()
No public properties found
No constants found
No protected methods found
$messages
$fallback
$formatter
N/A
No private methods found
No private properties found
N/A

Properties

$messages

$messages : array

Message keys and translations in this package.

Type

array

$fallback

$fallback : string

The name of a fallback package to use when a message key does not exist.

Type

string

$formatter

$formatter : string

The name of the formatter to use when formatting translated messages.

Type

string

Methods

__construct()

__construct(string  $formatter = 'basic', string  $fallback = null, array  $messages = array()) 

Constructor.

Parameters

string $formatter

The name of the formatter to use.

string $fallback

The name of the fallback package to use.

array $messages

The messages in this package.

setMessages()

setMessages(array  $messages) : void

Sets the messages for this package.

Parameters

array $messages

The messages for this package.

addMessage()

addMessage(string  $key, string  $message) : void

Adds one message for this package.

Parameters

string $key

the key of the message

string $message

the actual message

addMessages()

addMessages(array  $messages) : void

Adds new messages for this package.

Parameters

array $messages

The messages to add in this package.

getMessages()

getMessages() : array

Gets the messages for this package.

Returns

array

getMessage()

getMessage(string  $key) : mixed

Gets the message of the given key for this package.

Parameters

string $key

the key of the message to return

Returns

mixed —

The message translation string, or false if not found.

setFormatter()

setFormatter(string  $formatter) : void

Sets the formatter name for this package.

Parameters

string $formatter

The formatter name for this package.

getFormatter()

getFormatter() : string

Gets the formatter name for this package.

Returns

string

setFallback()

setFallback(string  $fallback) : void

Sets the fallback package name.

Parameters

string $fallback

The fallback package name.

getFallback()

getFallback() : string

Gets the fallback package name.

Returns

string