Message Catalog
string|null
The name of a fallback package to use when a message key does not exist.
string
The name of the formatter to use when formatting translated messages.
array<array|string>
Message keys and translations in this package.
Constructor.
Adds one message for this package.
Adds new messages for this package.
Gets the fallback package name.
Gets the formatter name for this package.
Gets the message of the given key for this package.
Gets the messages for this package.
Sets the fallback package name.
Sets the formatter name for this package.
Sets the messages for this package.
__construct(string $formatter = 'default', string|null $fallback = null, array<array|string> $messages = [])
Constructor.
string
$formatter optional The name of the formatter to use.
string|null
$fallback optional The name of the fallback package to use.
array<array|string>
$messages optional The messages in this package.
addMessage(string $key, array|string $message): void
Adds one message for this package.
string
$key the key of the message
array|string
$message the actual message
void
addMessages(array<array|string> $messages): void
Adds new messages for this package.
array<array|string>
$messages The messages to add in this package.
void
getFallback(): string|null
Gets the fallback package name.
string|null
getFormatter(): string
Gets the formatter name for this package.
string
getMessage(string $key): array|string|false
Gets the message of the given key for this package.
string
$key the key of the message to return
array|string|false
getMessages(): array<array|string>
Gets the messages for this package.
array<array|string>
setFallback(string|null $fallback): void
Sets the fallback package name.
string|null
$fallback The fallback package name.
void
setFormatter(string $formatter): void
Sets the formatter name for this package.
string
$formatter The formatter name for this package.
void
setMessages(array<array|string> $messages): void
Sets the messages for this package.
array<array|string>
$messages The messages for this package.
void
The name of a fallback package to use when a message key does not exist.
string|null
The name of the formatter to use when formatting translated messages.
string
Message keys and translations in this package.
array<array|string>
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.I18n.Package.html