) => {
{/* LEFT */}
- Showing page {currentPage} of {pageCount}
+ {t('dataTable.pagination.showingPage', { current: currentPage, total: pageCount })}
- p {currentPage}/{pageCount}
+ {t('dataTable.pagination.showingPageShort', { current: currentPage, total: pageCount })}
@@ -47,11 +49,11 @@ export const PaginationBar = (props: PaginationBarProps) => {
hover:bg-background
data-[state=open]:bg-muted
"
- aria-label="Rows per page"
+ aria-label={t('dataTable.pagination.rowsPerPage')}
>
- {pageSize} / page
- {pageSize}/p
+ {t('dataTable.pagination.perPage', { size: pageSize })}
+ {t('dataTable.pagination.perPageShort', { size: pageSize })}
@@ -66,8 +68,8 @@ export const PaginationBar = (props: PaginationBarProps) => {
data-[state=checked]:text-muted-foreground
"
>
- {n} / page
- {n}/p
+ {t('dataTable.pagination.perPage', { size: n })}
+ {t('dataTable.pagination.perPageShort', { size: n })}
))}
@@ -82,7 +84,7 @@ export const PaginationBar = (props: PaginationBarProps) => {
className={buttonClass}
onClick={() => changePage(1)}
disabled={currentPage === 1}
- aria-label="First"
+ aria-label={t('dataTable.pagination.first')}
>
«
@@ -92,7 +94,7 @@ export const PaginationBar = (props: PaginationBarProps) => {
className={buttonClass}
onClick={() => changePage(currentPage - 1)}
disabled={currentPage === 1}
- aria-label="Prev"
+ aria-label={t('dataTable.pagination.prev')}
>
‹
@@ -102,7 +104,7 @@ export const PaginationBar = (props: PaginationBarProps) => {
className={buttonClass}
onClick={() => changePage(currentPage + 1)}
disabled={currentPage === pageCount}
- aria-label="Next"
+ aria-label={t('dataTable.pagination.next')}
>
›
@@ -112,7 +114,7 @@ export const PaginationBar = (props: PaginationBarProps) => {
className={buttonClass}
onClick={() => changePage(pageCount)}
disabled={currentPage === pageCount}
- aria-label="Last"
+ aria-label={t('dataTable.pagination.last')}
>
»
diff --git a/src/workspaces/components/SearchInput.tsx b/src/workspaces/components/SearchInput.tsx
index f51b0f30..7951c60d 100644
--- a/src/workspaces/components/SearchInput.tsx
+++ b/src/workspaces/components/SearchInput.tsx
@@ -3,6 +3,7 @@ import { Button } from '@/components/ui/button';
import { Search as SearchIcon, X as ClearIcon } from 'lucide-react';
import { Input } from '@/components/ui/input';
import { cn } from 'helpers/cn';
+import { useTranslation } from '@/components/locales';
type SearchInputProps = {
className?: string;
@@ -12,7 +13,8 @@ type SearchInputProps = {
};
export function SearchInput(props: SearchInputProps) {
- const { className, handleSearch, value = '', placeholder = 'Search' } = props;
+ const { t } = useTranslation();
+ const { className, handleSearch, value = '', placeholder = t('search.placeholder') } = props;
const [isMobileSearchOpen, setIsMobileSearchOpen] = useState(false);
const inputRef = useRef(null);
@@ -22,14 +24,14 @@ export function SearchInput(props: SearchInputProps) {
type="button"
variant="outline"
size="icon"
- aria-label={isMobileSearchOpen ? 'Close search' : 'Open search'}
+ aria-label={isMobileSearchOpen ? t('search.close') : t('search.open')}
onClick={() => {
setIsMobileSearchOpen((v) => !v);
if (!isMobileSearchOpen) {
setTimeout(() => inputRef.current?.focus(), 160);
}
}}
- className="ml-auto shrink-0 md:hidden"
+ className="ms-auto shrink-0 md:hidden"
>
{isMobileSearchOpen ? : }
@@ -37,7 +39,7 @@ export function SearchInput(props: SearchInputProps) {
className={cn(
'relative w-fit max-w-lg',
isMobileSearchOpen
- ? 'absolute left-0 mt-4 block w-full md:relative md:mt-0 md:w-fit'
+ ? 'absolute start-0 mt-4 block w-full md:relative md:mt-0 md:w-fit'
: 'hidden w-auto md:block',
className,
)}
@@ -45,14 +47,14 @@ export function SearchInput(props: SearchInputProps) {
{!!value ? (
) : (
-
+
)}
@@ -62,7 +64,7 @@ export function SearchInput(props: SearchInputProps) {
placeholder={placeholder}
value={value}
onChange={(ev) => handleSearch(ev.target.value)}
- className="pl-10 pr-4 text-sm"
+ className="ps-10 pe-4 text-sm"
/>
diff --git a/src/workspaces/components/Select.tsx b/src/workspaces/components/Select.tsx
index 928d7712..77541247 100644
--- a/src/workspaces/components/Select.tsx
+++ b/src/workspaces/components/Select.tsx
@@ -1,10 +1,12 @@
import { Select as ShadSelect, SelectContent, SelectGroup } from '@/components/ui/select';
import { SelectItem, SelectLabel, SelectTrigger, SelectValue } from '@/components/ui/select';
import { cn } from 'helpers/cn';
+import { useTranslation } from '@/components/locales';
export const Select = (props: SelectProps) => {
+ const { t } = useTranslation();
const { options, value, onChange, onValueChange, label } = props;
- const { name = '', className, placeholder = 'Select...', update } = props;
+ const { name = '', className, placeholder = t('select.placeholder'), update } = props;
if (!options) return null;
diff --git a/src/workspaces/components/Tabs/Tabs.tsx b/src/workspaces/components/Tabs/Tabs.tsx
index 89961211..64a7f407 100644
--- a/src/workspaces/components/Tabs/Tabs.tsx
+++ b/src/workspaces/components/Tabs/Tabs.tsx
@@ -1,6 +1,7 @@
import { useRef } from 'react';
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@/components/ui/select';
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
+import { useTranslation } from '@/components/locales';
type TabsProps = {
tabList: { value: string; label: string }[];
@@ -8,6 +9,7 @@ type TabsProps = {
setActiveTab: (tab: string) => void;
};
const TabsComponent = (props: TabsProps) => {
+ const { t } = useTranslation();
const { tabList, activeTab, setActiveTab } = props;
const tabsListRef = useRef(null);
return (
@@ -38,7 +40,7 @@ const TabsComponent = (props: TabsProps) => {