|
@@ -17,6 +17,8 @@ use Symfony\Component\Config\Resource\ResourceInterface;
|
|
|
* MessageCatalogueInterface.
|
|
|
*
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
interface MessageCatalogueInterface
|
|
|
{
|
|
@@ -24,6 +26,8 @@ interface MessageCatalogueInterface
|
|
|
* Gets the catalogue locale.
|
|
|
*
|
|
|
* @return string The locale
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function getLocale();
|
|
|
|
|
@@ -31,6 +35,8 @@ interface MessageCatalogueInterface
|
|
|
* Gets the domains.
|
|
|
*
|
|
|
* @return array An array of domains
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function getDomains();
|
|
|
|
|
@@ -42,6 +48,8 @@ interface MessageCatalogueInterface
|
|
|
* @param string $domain The domain name
|
|
|
*
|
|
|
* @return array An array of messages
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function all($domain = null);
|
|
|
|
|
@@ -51,6 +59,8 @@ interface MessageCatalogueInterface
|
|
|
* @param string $id The message id
|
|
|
* @param string $translation The messages translation
|
|
|
* @param string $domain The domain name
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function set($id, $translation, $domain = 'messages');
|
|
|
|
|
@@ -61,6 +71,8 @@ interface MessageCatalogueInterface
|
|
|
* @param string $domain The domain name
|
|
|
*
|
|
|
* @return Boolean true if the message has a translation, false otherwise
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function has($id, $domain = 'messages');
|
|
|
|
|
@@ -71,6 +83,8 @@ interface MessageCatalogueInterface
|
|
|
* @param string $domain The domain name
|
|
|
*
|
|
|
* @return string The message translation
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function get($id, $domain = 'messages');
|
|
|
|
|
@@ -79,6 +93,8 @@ interface MessageCatalogueInterface
|
|
|
*
|
|
|
* @param string $messages An array of translations
|
|
|
* @param string $domain The domain name
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function replace($messages, $domain = 'messages');
|
|
|
|
|
@@ -87,6 +103,8 @@ interface MessageCatalogueInterface
|
|
|
*
|
|
|
* @param string $messages An array of translations
|
|
|
* @param string $domain The domain name
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function add($messages, $domain = 'messages');
|
|
|
|
|
@@ -96,6 +114,8 @@ interface MessageCatalogueInterface
|
|
|
* The two catalogues must have the same locale.
|
|
|
*
|
|
|
* @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function addCatalogue(MessageCatalogueInterface $catalogue);
|
|
|
|
|
@@ -106,6 +126,8 @@ interface MessageCatalogueInterface
|
|
|
* This is used to provide default translations when they do not exist for the current locale.
|
|
|
*
|
|
|
* @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function addFallbackCatalogue(MessageCatalogueInterface $catalogue);
|
|
|
|
|
@@ -113,6 +135,8 @@ interface MessageCatalogueInterface
|
|
|
* Returns an array of resources loaded to build this collection.
|
|
|
*
|
|
|
* @return ResourceInterface[] An array of resources
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function getResources();
|
|
|
|
|
@@ -120,6 +144,8 @@ interface MessageCatalogueInterface
|
|
|
* Adds a resource for this collection.
|
|
|
*
|
|
|
* @param ResourceInterface $resource A resource instance
|
|
|
+ *
|
|
|
+ * @api
|
|
|
*/
|
|
|
function addResource(ResourceInterface $resource);
|
|
|
}
|