feat(i18n): Implement multilingual support with Polish and English translations
- Added translation context and provider for managing language state. - Integrated translation functionality into existing components (TaskStatusDropdown, Navigation). - Created LanguageSwitcher component for language selection. - Updated task statuses and navigation labels to use translations. - Added Polish translations for various UI elements, including navigation, tasks, projects, and contracts. - Refactored utility functions to return localized strings for deadlines and date formatting.
This commit is contained in:
@@ -14,8 +14,10 @@ import PageHeader from "@/components/ui/PageHeader";
|
||||
import SearchBar from "@/components/ui/SearchBar";
|
||||
import FilterBar from "@/components/ui/FilterBar";
|
||||
import { LoadingState } from "@/components/ui/States";
|
||||
import { useTranslation } from "@/lib/i18n";
|
||||
|
||||
export default function ProjectTasksPage() {
|
||||
const { t } = useTranslation();
|
||||
const [allTasks, setAllTasks] = useState([]);
|
||||
const [filteredTasks, setFilteredTasks] = useState([]);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
@@ -148,25 +150,25 @@ export default function ProjectTasksPage() {
|
||||
|
||||
const filterOptions = [
|
||||
{
|
||||
label: "Status",
|
||||
label: t('tasks.status'),
|
||||
value: statusFilter,
|
||||
onChange: (e) => setStatusFilter(e.target.value),
|
||||
options: [
|
||||
{ value: "all", label: "All" },
|
||||
{ value: "pending", label: "Pending" },
|
||||
{ value: "in_progress", label: "In Progress" },
|
||||
{ value: "completed", label: "Completed" },
|
||||
{ value: "all", label: t('common.all') },
|
||||
{ value: "pending", label: t('taskStatus.pending') },
|
||||
{ value: "in_progress", label: t('taskStatus.in_progress') },
|
||||
{ value: "completed", label: t('taskStatus.completed') },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Priority",
|
||||
label: t('tasks.priority'),
|
||||
value: priorityFilter,
|
||||
onChange: (e) => setPriorityFilter(e.target.value),
|
||||
options: [
|
||||
{ value: "all", label: "All" },
|
||||
{ value: "high", label: "High" },
|
||||
{ value: "normal", label: "Normal" },
|
||||
{ value: "low", label: "Low" },
|
||||
{ value: "all", label: t('common.all') },
|
||||
{ value: "high", label: t('tasks.high') },
|
||||
{ value: "normal", label: t('tasks.medium') },
|
||||
{ value: "low", label: t('tasks.low') },
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -174,8 +176,8 @@ export default function ProjectTasksPage() {
|
||||
return (
|
||||
<PageContainer>
|
||||
<PageHeader
|
||||
title="Project Tasks"
|
||||
description="Monitor and manage tasks across all projects"
|
||||
title={t('tasks.title')}
|
||||
description={t('tasks.subtitle')}
|
||||
/>
|
||||
<SearchBar
|
||||
searchTerm={searchTerm}
|
||||
@@ -206,7 +208,7 @@ export default function ProjectTasksPage() {
|
||||
</svg>
|
||||
</div>
|
||||
<div className="ml-4">
|
||||
<p className="text-sm font-medium text-gray-600">Total Tasks</p>
|
||||
<p className="text-sm font-medium text-gray-600">{t('dashboard.totalTasks')}</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{statusCounts.all}
|
||||
</p>
|
||||
@@ -233,7 +235,7 @@ export default function ProjectTasksPage() {
|
||||
</svg>
|
||||
</div>
|
||||
<div className="ml-4">
|
||||
<p className="text-sm font-medium text-gray-600">Pending</p>
|
||||
<p className="text-sm font-medium text-gray-600">{t('taskStatus.pending')}</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{statusCounts.pending}
|
||||
</p>
|
||||
@@ -260,7 +262,7 @@ export default function ProjectTasksPage() {
|
||||
</svg>
|
||||
</div>
|
||||
<div className="ml-4">
|
||||
<p className="text-sm font-medium text-gray-600">In Progress</p>
|
||||
<p className="text-sm font-medium text-gray-600">{t('taskStatus.in_progress')}</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{statusCounts.in_progress}
|
||||
</p>
|
||||
@@ -287,7 +289,7 @@ export default function ProjectTasksPage() {
|
||||
</svg>
|
||||
</div>
|
||||
<div className="ml-4">
|
||||
<p className="text-sm font-medium text-gray-600">Completed</p>
|
||||
<p className="text-sm font-medium text-gray-600">{t('taskStatus.completed')}</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{statusCounts.completed}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user