MessageCatalogue

Catalogue of loaded translation strings for a language

since

2.0

package

Joomla Framework

Methods

__construct

MessageCatalogue constructor.

__construct( language, mixed||string|int messages = []) : 
since

2.0

Arguments

language

stringThe language of the messages in this catalogue

messages

array<string|int, mixed>The messages to seed this catalogue with

Response

mixed

addMessage

Add a message to the catalogue, replacing the key if it already exists

addMessage( key,  message) : 

Arguments

key

stringThe key identifying the message

message

stringThe message for this key

Response

void

addMessages

Add messages to the catalogue, replacing any keys which already exist

addMessages(mixed||string|int messages) : 
since

2.0

Arguments

messages

array<string|int, mixed>An associative array containing the messages to add to the catalogue

Response

void

definesMessage

Check if this catalogue has a message for the given key, ignoring a fallback if defined

definesMessage( key) : 
since

2.0

Arguments

key

stringThe key to check

Response

bool

getFallbackCatalogue

Get the fallback for this catalogue if set

getFallbackCatalogue() : \Joomla\Language\MessageCatalogue|null
since

2.0

Response

MessageCatalogue|null

getLanguage

Get the language for this catalogue

getLanguage() : 
since

2.0

Response

string

getMessage

Get the message for a given key

getMessage( key) : 
since

2.0

Arguments

key

stringThe key to get the message for

Response

stringThe message if one is set otherwise the key

getMessages

Fetch the messages stored in this catalogue

getMessages() : mixed||string|int
since

2.0

Response

array<string|int, mixed>

hasMessage

Check if the catalogue has a message for the given key

hasMessage( key) : 
since

2.0

Arguments

key

stringThe key to check

Response

bool

mergeCatalogue

Merge another catalogue into this one

mergeCatalogue(\Joomla\Language\MessageCatalogue messageCatalogue) : 
since

2.0

throws

LogicException

Arguments

messageCatalogue

MessageCatalogueThe catalogue to merge

Response

void

setFallbackCatalogue

Set the fallback for this catalogue

setFallbackCatalogue(\Joomla\Language\MessageCatalogue messageCatalogue) : 
since

2.0

Arguments

messageCatalogue

MessageCatalogueThe catalogue to use as the fallback

Response

void

Properties

fallbackCatalogue

A fallback for this catalogue

since

2.0

Type(s)

MessageCatalogue

language

The language of the messages in this catalogue

since

2.0

Type(s)

string

messages

The messages stored to this catalogue

since

2.0

Type(s)

array<string|int, mixed>