composer package updates
[openemr.git] / vendor / symfony / translation / MessageCatalogueInterface.php
blob40054f05c4c18520502ee154eb6be7243ecfec4d
1 <?php
3 /*
4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Translation;
14 use Symfony\Component\Config\Resource\ResourceInterface;
16 /**
17 * MessageCatalogueInterface.
19 * @author Fabien Potencier <fabien@symfony.com>
21 interface MessageCatalogueInterface
23 /**
24 * Gets the catalogue locale.
26 * @return string The locale
28 public function getLocale();
30 /**
31 * Gets the domains.
33 * @return array An array of domains
35 public function getDomains();
37 /**
38 * Gets the messages within a given domain.
40 * If $domain is null, it returns all messages.
42 * @param string $domain The domain name
44 * @return array An array of messages
46 public function all($domain = null);
48 /**
49 * Sets a message translation.
51 * @param string $id The message id
52 * @param string $translation The messages translation
53 * @param string $domain The domain name
55 public function set($id, $translation, $domain = 'messages');
57 /**
58 * Checks if a message has a translation.
60 * @param string $id The message id
61 * @param string $domain The domain name
63 * @return bool true if the message has a translation, false otherwise
65 public function has($id, $domain = 'messages');
67 /**
68 * Checks if a message has a translation (it does not take into account the fallback mechanism).
70 * @param string $id The message id
71 * @param string $domain The domain name
73 * @return bool true if the message has a translation, false otherwise
75 public function defines($id, $domain = 'messages');
77 /**
78 * Gets a message translation.
80 * @param string $id The message id
81 * @param string $domain The domain name
83 * @return string The message translation
85 public function get($id, $domain = 'messages');
87 /**
88 * Sets translations for a given domain.
90 * @param array $messages An array of translations
91 * @param string $domain The domain name
93 public function replace($messages, $domain = 'messages');
95 /**
96 * Adds translations for a given domain.
98 * @param array $messages An array of translations
99 * @param string $domain The domain name
101 public function add($messages, $domain = 'messages');
104 * Merges translations from the given Catalogue into the current one.
106 * The two catalogues must have the same locale.
108 * @param self $catalogue
110 public function addCatalogue(MessageCatalogueInterface $catalogue);
113 * Merges translations from the given Catalogue into the current one
114 * only when the translation does not exist.
116 * This is used to provide default translations when they do not exist for the current locale.
118 * @param self $catalogue
120 public function addFallbackCatalogue(MessageCatalogueInterface $catalogue);
123 * Gets the fallback catalogue.
125 * @return self|null A MessageCatalogueInterface instance or null when no fallback has been set
127 public function getFallbackCatalogue();
130 * Returns an array of resources loaded to build this collection.
132 * @return ResourceInterface[] An array of resources
134 public function getResources();
137 * Adds a resource for this collection.
139 * @param ResourceInterface $resource A resource instance
141 public function addResource(ResourceInterface $resource);