MessageCatalogueInterface::all()

array all(string $domain = null) Gets the messages within a given domain. If $domain is null, it returns all messages. Parameters string $domain The domain name Return Value array An array of messages

MessageCatalogueInterface::addResource()

addResource(ResourceInterface $resource) Adds a resource for this collection. Parameters ResourceInterface $resource A resource instance

MessageCatalogueInterface::addFallbackCatalogue()

addFallbackCatalogue(MessageCatalogueInterface $catalogue) Merges translations from the given Catalogue into the current one only when the translation does not exist. This is used to provide default translations when they do not exist for the current locale. Parameters MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance

MessageCatalogueInterface::addCatalogue()

addCatalogue(MessageCatalogueInterface $catalogue) Merges translations from the given Catalogue into the current one. The two catalogues must have the same locale. Parameters MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance

MessageCatalogueInterface::add()

add(array $messages, string $domain = 'messages') Adds translations for a given domain. Parameters array $messages An array of translations string $domain The domain name

MessageCatalogueInterface

interface MessageCatalogueInterface MessageCatalogueInterface. Methods string getLocale() Gets the catalogue locale. array getDomains() Gets the domains. array all(string $domain = null) Gets the messages within a given domain. set(string $id, string $translation, string $domain = 'messages') Sets a message translation. bool has(string $id, string $domain = 'messages') Checks if a message has a translation. bool defines(string $id, string $domain = 'messages') Ch

MessageCatalogue::setMetadata()

setMetadata(string $key, mixed $value, string $domain = 'messages') Adds metadata to a message domain. Parameters string $key The key mixed $value The value string $domain The domain name

MessageCatalogue::replace()

replace(array $messages, string $domain = 'messages') Sets translations for a given domain. Parameters array $messages An array of translations string $domain The domain name

MessageCatalogue::has()

bool has(string $id, string $domain = 'messages') Checks if a message has a translation. Parameters string $id The message id string $domain The domain name Return Value bool true if the message has a translation, false otherwise

MessageCatalogue::getResources()

ResourceInterface[] getResources() Returns an array of resources loaded to build this collection. Return Value ResourceInterface[] An array of resources