Skip to content

Commit

Permalink
use locale instead of hardcoded string
Browse files Browse the repository at this point in the history
  • Loading branch information
PartyWumpus authored Nov 11, 2023
1 parent 27858c7 commit d200798
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions backend/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@
"about": "About",
"alph_asce": "Alphabetical (Z to A)",
"alph_desc": "Alphabetical (A to Z)",
"date_asce": "Newest first",
"date_desc": "Oldest first",
"title": "Browse"
},
"store_testing_cta": "Please consider testing new plugins to help the Decky Loader team!",
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/store/Store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const BrowseTab: FC<{ children: { setPluginCount: Dispatch<SetStateAction<number
(): DropdownOption[] => [
{ data: 1, label: t('Store.store_tabs.alph_desc') },
{ data: 2, label: t('Store.store_tabs.alph_asce') },
{ data: 3, label: 'date ascending' },
{ data: 4, label: 'date descending' },
{ data: 3, label: t('Store.store_tabs.date_desc') },
{ data: 4, label: t('Store.store_tabs.date_asce') },
],
[],
);
Expand All @@ -87,19 +87,19 @@ const BrowseTab: FC<{ children: { setPluginCount: Dispatch<SetStateAction<number
let direction = null;
switch (selectedSort) {
case 1:
direction = SortDirections.ascending;
direction = SortDirections.descending;
sort = SortOptions.name;
break;
case 2:
direction = SortDirections.descending;
direction = SortDirections.ascending;
sort = SortOptions.name;
break;
case 3:
direction = SortDirections.ascending;
direction = SortDirections.descending;
sort = SortOptions.date;
break;
case 4:
direction = SortDirections.descending;
direction = SortDirections.ascending;
sort = SortOptions.date;
break;
}
Expand Down

0 comments on commit d200798

Please sign in to comment.