diff --git a/core/lib/Drupal/Core/Language/Language.php b/core/lib/Drupal/Core/Language/Language.php index 8a69882..675ca47 100644 --- a/core/lib/Drupal/Core/Language/Language.php +++ b/core/lib/Drupal/Core/Language/Language.php @@ -155,9 +155,10 @@ public static function sort(&$languages) { if ($a_weight == $b_weight) { $a_name = $a->getName(); $b_name = $b->getName(); - // If the name is TranslatableMarkup we can not get the translation - // because the can cuase recursion with sorting languages. Determine - // order based on ID if this is the case. + // If either name is a TranslatableMarkup object it can not be converted + // to a string. This is because translation requires a sorted list of + // languages thereby causing an infinite loop. Determine the order based + // on ID if this is the case. if ($a_name instanceof TranslatableMarkup || $b_name instanceof TranslatableMarkup) { $a_name = $a->getId(); $b_name = $b->getId();