composer package updates
[openemr.git] / vendor / symfony / translation / TranslatorInterface.php
blob9fcfd5bcf40510d8c22cc6d6375541e0ec32a189
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\Translation\Exception\InvalidArgumentException;
16 /**
17 * TranslatorInterface.
19 * @author Fabien Potencier <fabien@symfony.com>
21 interface TranslatorInterface
23 /**
24 * Translates the given message.
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
31 * @return string The translated string
33 * @throws InvalidArgumentException If the locale contains invalid characters
35 public function trans($id, array $parameters = array(), $domain = null, $locale = null);
37 /**
38 * Translates the given choice message by choosing a translation according to a number.
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
46 * @return string The translated string
48 * @throws InvalidArgumentException If the locale contains invalid characters
50 public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);
52 /**
53 * Sets the current locale.
55 * @param string $locale The locale
57 * @throws InvalidArgumentException If the locale contains invalid characters
59 public function setLocale($locale);
61 /**
62 * Returns the current locale.
64 * @return string The locale
66 public function getLocale();