feat: Implement internationalization for task management components
- Added translation support for task-related strings in ProjectTaskForm and ProjectTasksSection components. - Integrated translation for navigation items in the Navigation component. - Created ProjectCalendarWidget component with Polish translations for project statuses and deadlines. - Developed Tooltip component for enhanced user experience with tooltips. - Established a field change history logging system in the database with associated queries. - Enhanced task update logging to include translated status and priority changes. - Introduced server-side translations for system messages to improve localization.
This commit is contained in:
@@ -103,11 +103,11 @@ export default function ProjectForm({ initialData = null }) {
|
||||
router.push("/projects");
|
||||
}
|
||||
} else {
|
||||
alert("Failed to save project.");
|
||||
alert(t('projects.saveError'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error saving project:", error);
|
||||
alert("Failed to save project.");
|
||||
alert(t('projects.saveError'));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ export default function ProjectForm({ initialData = null }) {
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<h2 className="text-xl font-semibold text-gray-900">
|
||||
{isEdit ? "Edit Project Details" : "Project Details"}
|
||||
{isEdit ? t('projects.editProjectDetails') : t('projects.projectDetails')}
|
||||
</h2>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
@@ -125,7 +125,7 @@ export default function ProjectForm({ initialData = null }) {
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Contract <span className="text-red-500">*</span>
|
||||
{t('projects.contract')} <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<select
|
||||
name="contract_id"
|
||||
@@ -134,7 +134,7 @@ export default function ProjectForm({ initialData = null }) {
|
||||
className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"
|
||||
required
|
||||
>
|
||||
<option value="">Select Contract</option>
|
||||
<option value="">{t('projects.selectContract')}</option>
|
||||
{contracts.map((contract) => (
|
||||
<option
|
||||
key={contract.contract_id}
|
||||
@@ -148,7 +148,7 @@ export default function ProjectForm({ initialData = null }) {
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Typ projektu <span className="text-red-500">*</span>
|
||||
{t('projects.type')} <span className="text-red-500">*</span>
|
||||
</label>
|
||||
<select
|
||||
name="project_type"
|
||||
@@ -287,19 +287,19 @@ export default function ProjectForm({ initialData = null }) {
|
||||
{/* Additional Information Section */}
|
||||
<div className="border-t pt-6">
|
||||
<h3 className="text-lg font-medium text-gray-900 mb-4">
|
||||
Additional Information
|
||||
{t('projects.additionalInfo')}
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Investment Number
|
||||
{t('projects.investmentNumber')}
|
||||
</label>
|
||||
<Input
|
||||
type="text"
|
||||
name="investment_number"
|
||||
value={form.investment_number || ""}
|
||||
onChange={handleChange}
|
||||
placeholder="Enter investment number"
|
||||
placeholder={t('projects.placeholders.investmentNumber')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -312,7 +312,7 @@ export default function ProjectForm({ initialData = null }) {
|
||||
name="wp"
|
||||
value={form.wp || ""}
|
||||
onChange={handleChange}
|
||||
placeholder="Enter WP"
|
||||
placeholder={t('projects.placeholders.wp')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user