Skip to content

Commit 33de3eb

Browse files
Merge pull request #225 from PaperMold/i18n/files-header-translations
Added translations for static labels in FilesHeader
2 parents c0ef218 + ebe672f commit 33de3eb

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

frontend/src/FileManager/FileList/FilesHeader.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import { useMemo, useState } from "react";
22
import Checkbox from "../../components/Checkbox/Checkbox";
33
import { useFileNavigation } from "../../contexts/FileNavigationContext";
44
import { useSelection } from "../../contexts/SelectionContext";
5+
import { useTranslation } from "../../contexts/TranslationProvider";
56

67
const FilesHeader = ({ unselectFiles, onSort, sortConfig }) => {
8+
const t = useTranslation();
9+
710
const [showSelectAll, setShowSelectAll] = useState(false);
811

912
const { selectedFiles, setSelectedFiles } = useSelection();
@@ -49,7 +52,7 @@ const FilesHeader = ({ unselectFiles, onSort, sortConfig }) => {
4952
className={`file-name ${sortConfig?.key === "name" ? "active" : ""}`}
5053
onClick={() => handleSort("name")}
5154
>
52-
Name
55+
{t("name")}
5356
{sortConfig?.key === "name" && (
5457
<span className="sort-indicator">{sortConfig.direction === "asc" ? " ▲" : " ▼"}</span>
5558
)}
@@ -58,7 +61,7 @@ const FilesHeader = ({ unselectFiles, onSort, sortConfig }) => {
5861
className={`file-date ${sortConfig?.key === "modified" ? "active" : ""}`}
5962
onClick={() => handleSort("modified")}
6063
>
61-
Modified
64+
{t("modified")}
6265
{sortConfig?.key === "modified" && (
6366
<span className="sort-indicator">{sortConfig.direction === "asc" ? " ▲" : " ▼"}</span>
6467
)}
@@ -67,7 +70,7 @@ const FilesHeader = ({ unselectFiles, onSort, sortConfig }) => {
6770
className={`file-size ${sortConfig?.key === "size" ? "active" : ""}`}
6871
onClick={() => handleSort("size")}
6972
>
70-
Size
73+
{t("size")}
7174
{sortConfig?.key === "size" && (
7275
<span className="sort-indicator">{sortConfig.direction === "asc" ? " ▲" : " ▼"}</span>
7376
)}
@@ -76,4 +79,4 @@ const FilesHeader = ({ unselectFiles, onSort, sortConfig }) => {
7679
);
7780
};
7881

79-
export default FilesHeader;
82+
export default FilesHeader;

0 commit comments

Comments
 (0)