interface TranslatorInterface
Same name in this branch
- 9 core/lib/Drupal/Core/Validation/TranslatorInterface.php \Drupal\Core\Validation\TranslatorInterface
Same name in other branches
- 8.9.x core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php \Drupal\Core\StringTranslation\Translator\TranslatorInterface
- 8.9.x core/lib/Drupal/Core/Validation/TranslatorInterface.php \Drupal\Core\Validation\TranslatorInterface
- 10 core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php \Drupal\Core\StringTranslation\Translator\TranslatorInterface
- 10 core/lib/Drupal/Core/Validation/TranslatorInterface.php \Drupal\Core\Validation\TranslatorInterface
- 11.x core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php \Drupal\Core\StringTranslation\Translator\TranslatorInterface
- 11.x core/lib/Drupal/Core/Validation/TranslatorInterface.php \Drupal\Core\Validation\TranslatorInterface
Interface for objects capable of string translation.
Hierarchy
- interface \Drupal\Core\StringTranslation\Translator\TranslatorInterface
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 - LocaleTranslation.php in core/
modules/ locale/ src/ LocaleTranslation.php - TranslationManager.php in core/
lib/ Drupal/ Core/ StringTranslation/ TranslationManager.php
File
-
core/
lib/ Drupal/ Core/ StringTranslation/ Translator/ TranslatorInterface.php, line 8
Namespace
Drupal\Core\StringTranslation\TranslatorView 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
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
TranslatorInterface::getStringTranslation | public | function | Retrieves English string to given language. | 3 |
TranslatorInterface::reset | public | function | Resets translation cache. | 3 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.