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:
@@ -34,9 +34,9 @@ export const formatProjectType = (type) => {
|
||||
};
|
||||
|
||||
export const getDeadlineText = (daysRemaining) => {
|
||||
if (daysRemaining === 0) return "Due Today";
|
||||
if (daysRemaining > 0) return `${daysRemaining} days left`;
|
||||
return `${Math.abs(daysRemaining)} days overdue`;
|
||||
if (daysRemaining === 0) return "Termin dzisiaj";
|
||||
if (daysRemaining > 0) return `${daysRemaining} dni pozostało`;
|
||||
return `${Math.abs(daysRemaining)} dni przeterminowane`;
|
||||
};
|
||||
|
||||
export const formatDate = (date, options = {}) => {
|
||||
@@ -46,7 +46,7 @@ export const formatDate = (date, options = {}) => {
|
||||
const dateObj = typeof date === "string" ? new Date(date) : date;
|
||||
|
||||
if (isNaN(dateObj.getTime())) {
|
||||
return "Invalid date";
|
||||
return "Nieprawidłowa data";
|
||||
}
|
||||
|
||||
// Default to DD.MM.YYYY format
|
||||
@@ -63,7 +63,7 @@ export const formatDate = (date, options = {}) => {
|
||||
return `${day}.${month}.${year}`;
|
||||
} catch (error) {
|
||||
console.error("Error formatting date:", error);
|
||||
return "Invalid date";
|
||||
return "Nieprawidłowa data";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user