TranslationManager::addTranslator

public TranslationManager::addTranslator(TranslatorInterface $translator, $priority = 0)

Appends a translation system to the translation chain.

Parameters

\Drupal\Core\StringTranslation\Translator\TranslatorInterface $translator: The translation interface to be appended to the translation chain.

int $priority: The priority of the logger being added.

Return value

$this

File

core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 66

Class

TranslationManager
Defines a chained translation implementation combining multiple translators.

Namespace

Drupal\Core\StringTranslation

Code

1
2
3
4
5
6
public function addTranslator(TranslatorInterface $translator, $priority = 0) {
  $this->translators[$priority][] = $translator;
  // Reset sorted translators property to trigger rebuild.
  $this->sortedTranslators = NULL;
  return $this;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.