interface MessageCatalogueInterface
MessageCatalogueInterface.
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') Checks if a message has a translation (it does not take into account the fallback mechanism). | |
string | get(string $id, string $domain = 'messages') Gets a message translation. | |
replace(array $messages, string $domain = 'messages') Sets translations for a given domain. | ||
add(array $messages, string $domain = 'messages') Adds translations for a given domain. | ||
addCatalogue(MessageCatalogueInterface $catalogue) Merges translations from the given Catalogue into the current one. | ||
addFallbackCatalogue(MessageCatalogueInterface $catalogue) Merges translations from the given Catalogue into the current one only when the translation does not exist. | ||
MessageCatalogueInterface|null | getFallbackCatalogue() Gets the fallback catalogue. | |
ResourceInterface[] | getResources() Returns an array of resources loaded to build this collection. | |
addResource(ResourceInterface $resource) Adds a resource for this collection. |
Gets the catalogue locale.
string | The locale |
Gets the domains.
array | An array of domains |
Gets the messages within a given domain.
If $domain is null, it returns all messages.
string | $domain | The domain name |
array | An array of messages |
Sets a message translation.
string | $id | The message id |
string | $translation | The messages translation |
string | $domain | The domain name |
Checks if a message has a translation.
string | $id | The message id |
string | $domain | The domain name |
bool | true if the message has a translation, false otherwise |
Checks if a message has a translation (it does not take into account the fallback mechanism).
string | $id | The message id |
string | $domain | The domain name |
bool | true if the message has a translation, false otherwise |
Gets a message translation.
string | $id | The message id |
string | $domain | The domain name |
string | The message translation |
Sets translations for a given domain.
array | $messages | An array of translations |
string | $domain | The domain name |
Adds translations for a given domain.
array | $messages | An array of translations |
string | $domain | The domain name |
Merges translations from the given Catalogue into the current one.
The two catalogues must have the same locale.
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.
MessageCatalogueInterface | $catalogue |
Gets the fallback catalogue.
MessageCatalogueInterface|null | A MessageCatalogueInterface instance or null when no fallback has been set |
Returns an array of resources loaded to build this collection.
ResourceInterface[] | An array of resources |
Adds a resource for this collection.
ResourceInterface | $resource |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Translation/MessageCatalogueInterface.html