MessageCatalogue::getMetadata()

mixed getMetadata(string $key = '', string $domain = 'messages') Gets metadata for the given domain and key. Passing an empty domain will return an array with all metadata indexed by domain and then by key. Passing an empty key will return an array with all metadata for the given domain. Parameters string $key The key string $domain The domain name Return Value mixed The value that was set or an array with the domains/keys or null

MessageCatalogue::getLocale()

string getLocale() Gets the catalogue locale. Return Value string The locale

MessageCatalogue::getFallbackCatalogue()

MessageCatalogueInterface|null getFallbackCatalogue() Gets the fallback catalogue. Return Value MessageCatalogueInterface|null A MessageCatalogueInterface instance or null when no fallback has been set

MessageCatalogue::getDomains()

array getDomains() Gets the domains. Return Value array An array of domains

MessageCatalogue::deleteMetadata()

deleteMetadata(string $key = '', string $domain = 'messages') Deletes metadata for the given key and domain. Passing an empty domain will delete all metadata. Passing an empty key will delete all metadata for the given domain. Parameters string $key The key string $domain The domain name

MessageCatalogue::defines()

bool defines(string $id, string $domain = 'messages') Checks if a message has a translation (it does not take into account the fallback mechanism). Parameters string $id The message id string $domain The domain name Return Value bool true if the message has a translation, false otherwise

MessageCatalogue::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

MessageCatalogue::addResource()

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

MessageCatalogue::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

MessageCatalogue::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