Skip to content

Commit

Permalink
Merge pull request #10368 from marmelab/fix-sort-button-translation
Browse files Browse the repository at this point in the history
Fix SortButton default translation
  • Loading branch information
djhi authored Nov 21, 2024
2 parents 59e442e + e607fa5 commit 1f4b1de
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/ra-ui-materialui/src/button/SortButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,16 @@ const SortButton = (props: SortButtonProps) => {
setAnchorEl(null);
};

const fieldLabel = translateLabel({
resource,
source: sort.field,
});
const buttonLabel = translate(label, {
field: translateLabel({
resource,
source: sort.field,
}),
field: fieldLabel,
field_lower_first:
typeof fieldLabel === 'string'
? fieldLabel.charAt(0).toLowerCase() + fieldLabel.slice(1)
: undefined,
order: translate(`ra.sort.${sort.order}`),
_: label,
});
Expand Down

0 comments on commit 1f4b1de

Please sign in to comment.