annotate vendor/symfony/translation/TranslatorInterface.php @ 19:fa3358dc1485 tip

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