You are here

interface TranslatorInterface in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/translation/TranslatorInterface.php \Symfony\Component\Translation\TranslatorInterface
  2. 8 vendor/symfony/css-selector/XPath/TranslatorInterface.php \Symfony\Component\CssSelector\XPath\TranslatorInterface
  3. 8 core/lib/Drupal/Core/Validation/TranslatorInterface.php \Drupal\Core\Validation\TranslatorInterface
  4. 8 core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php \Drupal\Core\StringTranslation\Translator\TranslatorInterface
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php \Drupal\Core\StringTranslation\Translator\TranslatorInterface

Interface for objects capable of string translation.

Hierarchy

Expanded class hierarchy of TranslatorInterface

All classes that implement TranslatorInterface

3 files declare their use of TranslatorInterface
LanguageRequestSubscriber.php in core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php
Contains \Drupal\language\EventSubscriber\LanguageRequestSubscriber.
LocaleTranslation.php in core/modules/locale/src/LocaleTranslation.php
Contains \Drupal\locale\LocaleTranslation.
TranslationManager.php in core/lib/Drupal/Core/StringTranslation/TranslationManager.php
Contains \Drupal\Core\StringTranslation\TranslationManager.

File

core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php, line 13
Contains \Drupal\Core\StringTranslation\Translator\TranslatorInterface.

Namespace

Drupal\Core\StringTranslation\Translator
View source
interface TranslatorInterface {

  /**
   * Retrieves English string to given language.
   *
   * @param string $langcode
   *   Language code to translate to.
   * @param string $string
   *   The source string.
   * @param string $context
   *   The string context.
   *
   * @return string|FALSE
   *   Translated string if there is a translation, FALSE if not.
   */
  public function getStringTranslation($langcode, $string, $context);

  /**
   * Resets translation cache.
   *
   * Since most translation systems implement some form of caching, this
   * provides a way to delete that cache.
   */
  public function reset();

}

Members

Namesort descending Modifiers Type Description Overrides
TranslatorInterface::getStringTranslation public function Retrieves English string to given language. 3
TranslatorInterface::reset public function Resets translation cache. 3