diff --git a/src/CoreBundle/Resources/translations/metamodels_default.en.xlf b/src/CoreBundle/Resources/translations/metamodels_default.en.xlf index 64b019f9a..c76a768bb 100644 --- a/src/CoreBundle/Resources/translations/metamodels_default.en.xlf +++ b/src/CoreBundle/Resources/translations/metamodels_default.en.xlf @@ -23,6 +23,15 @@ Value has its own translation in "%target%" + + Ascending + + + Descending + + + %attribute_name% (%direction%) + diff --git a/src/Helper/SortingLinkGenerator.php b/src/Helper/SortingLinkGenerator.php index d9c42e379..1b21e7565 100644 --- a/src/Helper/SortingLinkGenerator.php +++ b/src/Helper/SortingLinkGenerator.php @@ -139,6 +139,8 @@ public function generateSortingLink(IAttribute $attribute, string $type): array $this->updateSortingInFilterUrl($pageFilterUrl, $attributeName, $dir); + $direction = $this->translator->trans('sorting_direction_' . $dir, [], 'metamodels_default'); + return [ 'attribute' => $attribute, 'name' => $attribute->getName(), @@ -148,9 +150,9 @@ public function generateSortingLink(IAttribute $attribute, string $type): array 'active' => $active, 'class' => 'sort' . ($active ? ' active' : '') . ' ' . $dir, 'label' => $this->translator->trans( - 'MSC.orderMetaModelListBy' . ($dir === 'asc' ? 'Ascending' : 'Descending'), - [0 => $attribute->getName()], - 'contao_default' + 'sorting_direction_label', + ['%attribute_name%' => $attribute->getName(), '%direction%' => $direction], + 'metamodels_default' ), ]; }