interface TranslatorInterface

Same name in this branch

TranslatorInterface.

@author Fabien Potencier <fabien@symfony.com>

@api

Hierarchy

Expanded class hierarchy of TranslatorInterface

All classes that implement TranslatorInterface

7 files declare their use of TranslatorInterface
DefaultTranslator.php in drupal/core/vendor/symfony/validator/Symfony/Component/Validator/DefaultTranslator.php
DrupalTranslator.php in drupal/core/lib/Drupal/Core/Validation/DrupalTranslator.php
Contains \Drupal\Core\Validation\DrupalTranslator.
ExecutionContext.php in drupal/core/vendor/symfony/validator/Symfony/Component/Validator/ExecutionContext.php
ValidationVisitor.php in drupal/core/vendor/symfony/validator/Symfony/Component/Validator/ValidationVisitor.php
Validator.php in drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Validator.php

... See full list

File

drupal/core/vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php, line 21

Namespace

Symfony\Component\Translation
View source
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 $domain     The domain for the message
   * @param string $locale     The locale
   *
   * @return string The translated string
   *
   * @api
   */
  public function trans($id, array $parameters = array(), $domain = null, $locale = null);

  /**
   * 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)
   * @param integer $number     The number to use to find the indice of the message
   * @param array   $parameters An array of parameters for the message
   * @param string  $domain     The domain for the message
   * @param string  $locale     The locale
   *
   * @return string The translated string
   *
   * @api
   */
  public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);

  /**
   * Sets the current locale.
   *
   * @param string $locale The locale
   *
   * @api
   */
  public function setLocale($locale);

  /**
   * Returns the current locale.
   *
   * @return string The locale
   *
   * @api
   */
  public function getLocale();

}

Members

Namesort descending Modifiers Type Description Overrides
TranslatorInterface::getLocale public function Returns the current locale. 2
TranslatorInterface::setLocale public function Sets the current locale. 2
TranslatorInterface::trans public function Translates the given message. 2
TranslatorInterface::transChoice public function Translates the given choice message by choosing a translation according to a number. 2