]>
Commit | Line | Data |
---|---|---|
4f5b44bd NL |
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 | /** | |
15 | * TranslatorInterface. | |
16 | * | |
17 | * @author Fabien Potencier <fabien@symfony.com> | |
18 | * | |
19 | * @api | |
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 $domain The domain for the message | |
29 | * @param string $locale The locale | |
30 | * | |
31 | * @return string The translated string | |
32 | * | |
33 | * @api | |
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 integer $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 $domain The domain for the message | |
44 | * @param string $locale The locale | |
45 | * | |
46 | * @return string The translated string | |
47 | * | |
48 | * @api | |
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 | * @api | |
58 | */ | |
59 | public function setLocale($locale); | |
60 | ||
61 | /** | |
62 | * Returns the current locale. | |
63 | * | |
64 | * @return string The locale | |
65 | * | |
66 | * @api | |
67 | */ | |
68 | public function getLocale(); | |
69 | } |