Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Translation; Chris@0: Chris@0: use Symfony\Component\Translation\Exception\InvalidArgumentException; Chris@0: Chris@0: /** Chris@0: * TranslatorInterface. Chris@0: * Chris@0: * @author Fabien Potencier Chris@0: */ Chris@0: interface TranslatorInterface Chris@0: { Chris@0: /** Chris@0: * Translates the given message. Chris@0: * Chris@0: * @param string $id The message id (may also be an object that can be cast to string) Chris@0: * @param array $parameters An array of parameters for the message Chris@0: * @param string|null $domain The domain for the message or null to use the default Chris@0: * @param string|null $locale The locale or null to use the default Chris@0: * Chris@0: * @return string The translated string Chris@0: * Chris@0: * @throws InvalidArgumentException If the locale contains invalid characters Chris@0: */ Chris@17: public function trans($id, array $parameters = [], $domain = null, $locale = null); Chris@0: Chris@0: /** Chris@0: * Translates the given choice message by choosing a translation according to a number. Chris@0: * Chris@0: * @param string $id The message id (may also be an object that can be cast to string) Chris@17: * @param int $number The number to use to find the index of the message Chris@0: * @param array $parameters An array of parameters for the message Chris@0: * @param string|null $domain The domain for the message or null to use the default Chris@0: * @param string|null $locale The locale or null to use the default Chris@0: * Chris@0: * @return string The translated string Chris@0: * Chris@0: * @throws InvalidArgumentException If the locale contains invalid characters Chris@0: */ Chris@17: public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null); Chris@0: Chris@0: /** Chris@0: * Sets the current locale. Chris@0: * Chris@0: * @param string $locale The locale Chris@0: * Chris@0: * @throws InvalidArgumentException If the locale contains invalid characters Chris@0: */ Chris@0: public function setLocale($locale); Chris@0: Chris@0: /** Chris@0: * Returns the current locale. Chris@0: * Chris@0: * @return string The locale Chris@0: */ Chris@0: public function getLocale(); Chris@0: }