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:
@@ -1,8 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "@/lib/i18n";
|
||||
|
||||
export default function NoteForm({ projectId }) {
|
||||
const { t } = useTranslation();
|
||||
const [note, setNote] = useState("");
|
||||
const [status, setStatus] = useState(null);
|
||||
|
||||
@@ -17,10 +19,10 @@ export default function NoteForm({ projectId }) {
|
||||
|
||||
if (res.ok) {
|
||||
setNote("");
|
||||
setStatus("Note added");
|
||||
setStatus(t("common.addNoteSuccess"));
|
||||
window.location.reload();
|
||||
} else {
|
||||
setStatus("Failed to save note");
|
||||
setStatus(t("common.addNoteError"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +31,7 @@ export default function NoteForm({ projectId }) {
|
||||
<textarea
|
||||
value={note}
|
||||
onChange={(e) => setNote(e.target.value)}
|
||||
placeholder="Add a new note..."
|
||||
placeholder={t("common.addNotePlaceholder")}
|
||||
className="border p-2 w-full"
|
||||
rows={3}
|
||||
required
|
||||
@@ -38,7 +40,7 @@ export default function NoteForm({ projectId }) {
|
||||
type="submit"
|
||||
className="bg-blue-600 text-white px-4 py-2 rounded"
|
||||
>
|
||||
Add Note
|
||||
{t("common.addNote")}
|
||||
</button>
|
||||
{status && <p className="text-sm text-gray-600">{status}</p>}
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user