LocaleTranslation::__construct

public LocaleTranslation::__construct(StringStorageInterface $storage, CacheBackendInterface $cache, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager, RequestStack $request_stack) Constructs a translator using a string storage. Parameters \Drupal\locale\StringStorageInterface $storage: Storage to use when looking for new translations. \Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend. \Drupal\Core\Lock\LockBackendIn

LocaleTranslation::reset

public LocaleTranslation::reset() Resets translation cache. Since most translation systems implement some form of caching, this provides a way to delete that cache. Overrides TranslatorInterface::reset File core/modules/locale/src/LocaleTranslation.php, line 138 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code public function reset() { unset($this->translateEnglish); $this->translations = array(); }

LocaleTranslation::getStringTranslation

public LocaleTranslation::getStringTranslation($langcode, $string, $context) Retrieves English string to given language. Parameters string $langcode: Language code to translate to. string $string: The source string. string $context: The string context. Return value string|false Translated string if there is a translation, FALSE if not. Overrides TranslatorInterface::getStringTranslation File core/modules/locale/src/LocaleTranslation.php, line 108 Class LocaleTranslation String translator

LocaleTranslation::destruct

public LocaleTranslation::destruct() Performs destruct operations. Overrides DestructableInterface::destruct File core/modules/locale/src/LocaleTranslation.php, line 146 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code public function destruct() { foreach ($this->translations as $context) { foreach ($context as $lookup) { if ($lookup instanceof DestructableInterface) { $lookup->destruct(); } } } }

LocaleTranslation::canTranslateEnglish

protected LocaleTranslation::canTranslateEnglish() Gets translate english configuration value. Return value bool TRUE if english should be translated, FALSE if not. File core/modules/locale/src/LocaleTranslation.php, line 128 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code protected function canTranslateEnglish() { if (!isset($this->translateEnglish)) { $this->translateEnglish = $this->configFactory->get('locale.setting

LocaleTranslation::$translations

Cached translations. Array of \Drupal\locale\LocaleLookup objects indexed by language code and context. Type: array File core/modules/locale/src/LocaleTranslation.php, line 43 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code protected $translations = array();

LocaleTranslation::$translateEnglish

The translate english configuration value. Type: bool File core/modules/locale/src/LocaleTranslation.php, line 64 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code protected $translateEnglish;

LocaleTranslation::$storage

Storage for strings. Type: \Drupal\locale\StringStorageInterface File core/modules/locale/src/LocaleTranslation.php, line 27 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code protected $storage;

LocaleTranslation::$requestStack

The request stack. Type: \Symfony\Component\HttpFoundation\RequestStack File core/modules/locale/src/LocaleTranslation.php, line 78 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code protected $requestStack;

LocaleTranslation::$lock

The lock backend that should be used. Type: \Drupal\Core\Lock\LockBackendInterface File core/modules/locale/src/LocaleTranslation.php, line 57 Class LocaleTranslation String translator using the locale module. Namespace Drupal\locale Code protected $lock;