protected function TranslationManager::sortTranslators

protected TranslationManager::sortTranslators()

Sorts translators according to priority.

Return value

\Drupal\Core\StringTranslation\Translator\TranslatorInterface[] A sorted array of translator objects.

File

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

Class

TranslationManager
Defines a chained translation implementation combining multiple translators.

Namespace

Drupal\Core\StringTranslation

Code

protected function sortTranslators() {
  $sorted = array();
  krsort($this->translators);

  foreach ($this->translators as $translators) {
    $sorted = array_merge($sorted, $translators);
  }
  return $sorted;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StringTranslation!TranslationManager.php/function/TranslationManager::sortTranslators/8.1.x