Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / translation / TranslatorInterface.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Translation;
13
14 use Symfony\Component\Translation\Exception\InvalidArgumentException;
15
16 /**
17  * TranslatorInterface.
18  *
19  * @author Fabien Potencier <fabien@symfony.com>
20  */
21 interface TranslatorInterface
22 {
23     /**
24      * Translates the given message.
25      *
26      * @param string      $id         The message id (may also be an object that can be cast to string)
27      * @param array       $parameters An array of parameters for the message
28      * @param string|null $domain     The domain for the message or null to use the default
29      * @param string|null $locale     The locale or null to use the default
30      *
31      * @return string The translated string
32      *
33      * @throws InvalidArgumentException If the locale contains invalid characters
34      */
35     public function trans($id, array $parameters = array(), $domain = null, $locale = null);
36
37     /**
38      * Translates the given choice message by choosing a translation according to a number.
39      *
40      * @param string      $id         The message id (may also be an object that can be cast to string)
41      * @param int         $number     The number to use to find the indice of the message
42      * @param array       $parameters An array of parameters for the message
43      * @param string|null $domain     The domain for the message or null to use the default
44      * @param string|null $locale     The locale or null to use the default
45      *
46      * @return string The translated string
47      *
48      * @throws InvalidArgumentException If the locale contains invalid characters
49      */
50     public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);
51
52     /**
53      * Sets the current locale.
54      *
55      * @param string $locale The locale
56      *
57      * @throws InvalidArgumentException If the locale contains invalid characters
58      */
59     public function setLocale($locale);
60
61     /**
62      * Returns the current locale.
63      *
64      * @return string The locale
65      */
66     public function getLocale();
67 }