Skip to content

Commit

Permalink
Add gettext to sortValues labels
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Aug 14, 2023
1 parent d29755e commit a2f908a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions assets/search/components/SearchResultsBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ import NewItemsIcon from '../NewItemsIcon';
class SearchResultsBarComponent extends React.Component<any, any> {
sortValues = [
{
label: 'Date (Newest)',
label: gettext('Date (Newest)'),
value: 'desc',
sortFunction: () => this.setSortQuery('desc'),
},
{
label: 'Date (Oldest)',
label: gettext('Date (Oldest)'),
value: 'asc',
sortFunction: () => this.setSortQuery('asc'),
},
{
label: 'Relevance',
label: gettext('Relevance'),
value: '',
sortFunction: () => false,
},
]
];

static propTypes: any;
static defaultProps: any;
Expand Down Expand Up @@ -137,7 +137,7 @@ class SearchResultsBarComponent extends React.Component<any, any> {
)}
<div className="navbar__button-group">
<Dropdown
label={gettext(`Sort by: {{sort}}`, {sort :this.state.sortValue})}
label={gettext('Sort by: {{sort}}', {sort :this.state.sortValue})}
>
{this.sortValues.map((value) => {
return (
Expand All @@ -146,14 +146,14 @@ class SearchResultsBarComponent extends React.Component<any, any> {
className='dropdown-item'
onClick={() => {
value.sortFunction();
this.setState({sortValue: value.label})
this.setState({sortValue: value.label});
console.log(value.sortFunction());

Check failure on line 150 in assets/search/components/SearchResultsBar/index.tsx

View workflow job for this annotation

GitHub Actions / client

Unexpected console statement

}}
>
{gettext(value.label)}
</button>
)})}
);})}
</Dropdown>
<button
className="nh-button nh-button--tertiary"
Expand Down

0 comments on commit a2f908a

Please sign in to comment.