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:
Chop
2025-07-27 22:01:15 +02:00
parent 9b6307eabe
commit e828aa660b
16 changed files with 1166 additions and 234 deletions

View File

@@ -3,12 +3,14 @@
import { useState, useEffect, useRef } from "react";
import { createPortal } from "react-dom";
import Badge from "@/components/ui/Badge";
import { useTranslation } from "@/lib/i18n";
export default function ProjectStatusDropdown({
project,
size = "md",
showDropdown = true,
}) {
const { t } = useTranslation();
const [status, setStatus] = useState(project.project_status);
const [loading, setLoading] = useState(false);
const [isOpen, setIsOpen] = useState(false);
@@ -21,19 +23,19 @@ export default function ProjectStatusDropdown({
const statusConfig = {
registered: {
label: "Registered",
label: t("projectStatus.registered"),
variant: "secondary",
},
in_progress_design: {
label: "In Progress (Design)",
label: t("projectStatus.in_progress_design"),
variant: "primary",
},
in_progress_construction: {
label: "In Progress (Construction)",
label: t("projectStatus.in_progress_construction"),
variant: "primary",
},
fulfilled: {
label: "Completed",
label: t("projectStatus.fulfilled"),
variant: "success",
},
};