This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Translation/TranslatorInterface.php

68 lines
2.2 KiB
PHP
Raw Normal View History

2010-09-27 08:45:29 +01:00
<?php
/*
* This file is part of the Symfony package.
2010-09-27 08:45:29 +01:00
*
* (c) Fabien Potencier <fabien@symfony.com>
2010-09-27 08:45:29 +01:00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2010-09-27 08:45:29 +01:00
*/
namespace Symfony\Component\Translation;
use Symfony\Component\Translation\Exception\InvalidArgumentException;
2010-09-27 08:45:29 +01:00
/**
* TranslatorInterface.
*
* @author Fabien Potencier <fabien@symfony.com>
2010-09-27 08:45:29 +01:00
*/
interface TranslatorInterface
{
/**
* Translates the given message.
*
* @param string $id The message id (may also be an object that can be cast to string)
* @param array $parameters An array of parameters for the message
* @param string|null $domain The domain for the message or null to use the default
* @param string|null $locale The locale or null to use the default
2010-09-27 08:45:29 +01:00
*
* @return string The translated string
*
* @throws InvalidArgumentException If the locale contains invalid characters
2010-09-27 08:45:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function trans($id, array $parameters = array(), $domain = null, $locale = null);
2010-09-27 08:45:29 +01:00
/**
* Translates the given choice message by choosing a translation according to a number.
*
* @param string $id The message id (may also be an object that can be cast to string)
Merge branch '2.3' into 2.4 * 2.3: made {@inheritdoc} annotations consistent across the board fixed types in phpdocs made phpdoc types consistent with those defined in Hack Add support Thai translations made types consistent with those defined in Hack removed extra/unsupported arguments [HttpKernel] fixed an error message [TwigBundle] removed undefined argument [Translation] Make IcuDatFileLoader/IcuResFileLoader::load invalid resource compatible with HHVM. Conflicts: src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php src/Symfony/Bundle/FrameworkBundle/Templating/Loader/FilesystemLoader.php src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php src/Symfony/Component/Config/Definition/ReferenceDumper.php src/Symfony/Component/Console/Helper/DescriptorHelper.php src/Symfony/Component/Debug/ErrorHandler.php src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php src/Symfony/Component/HttpFoundation/Response.php src/Symfony/Component/HttpFoundation/StreamedResponse.php src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php src/Symfony/Component/Stopwatch/StopwatchPeriod.php src/Symfony/Component/Translation/TranslatorInterface.php src/Symfony/Component/Validator/ConstraintValidatorFactory.php
2014-04-16 09:02:57 +01:00
* @param int $number The number to use to find the indice of the message
* @param array $parameters An array of parameters for the message
* @param string|null $domain The domain for the message or null to use the default
* @param string|null $locale The locale or null to use the default
2010-09-27 08:45:29 +01:00
*
* @return string The translated string
*
* @throws InvalidArgumentException If the locale contains invalid characters
2010-09-27 08:45:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);
2010-09-27 08:45:29 +01:00
/**
* Sets the current locale.
*
* @param string $locale The locale
*
* @throws InvalidArgumentException If the locale contains invalid characters
2010-09-27 08:45:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function setLocale($locale);
2010-10-06 13:18:36 +01:00
/**
* Returns the current locale.
*
2010-10-16 11:32:57 +01:00
* @return string The locale
2010-10-06 13:18:36 +01:00
*/
2012-07-09 13:50:58 +01:00
public function getLocale();
2010-09-27 08:45:29 +01:00
}