From 23b3c5000f09b3699200da7f8dcc95e87c196c51 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Fri, 26 Dec 2025 15:29:02 +0100 Subject: [PATCH] feat: Add German, Spanish, and French translations and update i18n configuration. --- k-notes-frontend/i18n.ts | 2 +- k-notes-frontend/i18next.config.ts | 5 +- .../public/locales/de/translation.json | 65 +++++++++++++++++++ .../public/locales/en/translation.json | 10 ++- .../public/locales/es/translation.json | 65 +++++++++++++++++++ .../public/locales/fr/translation.json | 65 +++++++++++++++++++ .../public/locales/pl/translation.json | 11 +++- .../src/components/language-switcher.tsx | 5 +- 8 files changed, 220 insertions(+), 8 deletions(-) create mode 100644 k-notes-frontend/public/locales/de/translation.json create mode 100644 k-notes-frontend/public/locales/es/translation.json create mode 100644 k-notes-frontend/public/locales/fr/translation.json diff --git a/k-notes-frontend/i18n.ts b/k-notes-frontend/i18n.ts index 19de274..2084b43 100644 --- a/k-notes-frontend/i18n.ts +++ b/k-notes-frontend/i18n.ts @@ -9,7 +9,7 @@ i18next .use(initReactI18next) .init({ fallbackLng: "en", - supportedLngs: ["en", "pl"], + supportedLngs: ["en", "pl", "es", "de", "fr"], backend: { loadPath: "/locales/{{lng}}/{{ns}}.json", }, diff --git a/k-notes-frontend/i18next.config.ts b/k-notes-frontend/i18next.config.ts index 02189b2..8b07def 100644 --- a/k-notes-frontend/i18next.config.ts +++ b/k-notes-frontend/i18next.config.ts @@ -3,7 +3,10 @@ import { defineConfig } from 'i18next-cli'; export default defineConfig({ locales: [ "en", - "pl" + "pl", + "es", + "de", + "fr" ], extract: { input: "src/**/*.{js,jsx,ts,tsx}", diff --git a/k-notes-frontend/public/locales/de/translation.json b/k-notes-frontend/public/locales/de/translation.json new file mode 100644 index 0000000..503103a --- /dev/null +++ b/k-notes-frontend/public/locales/de/translation.json @@ -0,0 +1,65 @@ +{ + "{{count}} selected_one": "{{count}} ausgewählt", + "{{count}} selected_other": "{{count}} ausgewählt", + "Add a new note to your collection.": "Füge eine neue Notiz zu deiner Sammlung hinzu.", + "Archive": "Archiv", + "Archived {{count}} note_one": "{{count}} Notiz archiviert", + "Archived {{count}} note_other": "{{count}} Notizen archiviert", + "Are you sure you want to delete {{count}} note?_one": "Möchtest du wirklich {{count}} Notiz löschen?", + "Are you sure you want to delete {{count}} note?_other": "Möchtest du wirklich {{count}} Notizen löschen?", + "Are you sure?": "Bist du sicher?", + "Backend URL": "Backend-URL", + "Color": "Farbe", + "Configure the application settings.": "Konfiguriere die Anwendungseinstellungen.", + "Content": "Inhalt", + "Create": "Erstellen", + "Create Note": "Notiz erstellen", + "Data Management": "Datenverwaltung", + "Delete": "Löschen", + "Delete tag \"{{name}}\"? Notes will keep their content.": "Tag \"{{name}}\" löschen? Notizen behalten ihren Inhalt.", + "Deleted {{count}} note_one": "{{count}} Notiz gelöscht", + "Deleted {{count}} note_other": "{{count}} Notizen gelöscht", + "Edit Note": "Notiz bearbeiten", + "Export Data": "Daten exportieren", + "Export failed": "Export fehlgeschlagen", + "Export successful": "Export erfolgreich", + "Export your notes for backup or import from a JSON file.": "Exportiere deine Notizen für ein Backup oder importiere aus einer JSON-Datei.", + "Grid View": "Rasteransicht", + "History": "Verlauf", + "Import Data": "Daten importieren", + "Import failed": "Import fehlgeschlagen", + "Import successful. Reloading...": "Import erfolgreich. Wird neu geladen...", + "Invalid URL": "Ungültige URL", + "K-Notes": "K-Notes", + "Language": "Sprache", + "List View": "Listenansicht", + "New Note": "Neue Notiz", + "No archived notes yet": "Noch keine archivierten Notizen", + "No matching notes found": "Keine passenden Notizen gefunden", + "No notes with tag \"${activeTag}\"": "Keine Notizen mit Tag \"${activeTag}\"", + "No tags yet": "Noch keine Tags", + "Note content... Type / for commands": "Notizinhalt... Tippe / für Befehle", + "Note created": "Notiz erstellt", + "Note title": "Notiztitel", + "Note updated": "Notiz aktualisiert", + "Notes": "Notizen", + "Others": "Andere", + "Pin this note": "Diese Notiz anheften", + "Pinned": "Angeheftet", + "Rename": "Umbenennen", + "Save changes": "Änderungen speichern", + "Saving...": "Speichern...", + "Search your notes...": "Durchsuche deine Notizen...", + "Settings": "Einstellungen", + "Settings saved. Please refresh the page.": "Einstellungen gespeichert. Bitte aktualisiere die Seite.", + "Tag deleted": "Tag gelöscht", + "Tag renamed": "Tag umbenannt", + "Tags": "Tags", + "Tags (comma separated)": "Tags (durch Kommas getrennt)", + "Title": "Titel", + "Title is required": "Titel ist erforderlich", + "Title too long": "Titel zu lang", + "Update": "Aktualisieren", + "work, todo, ideas": "Arbeit, Aufgaben, Ideen", + "Your notes will appear here. Click + to create one.": "Deine Notizen werden hier erscheinen. Klicke +, um eine zu erstellen." +} \ No newline at end of file diff --git a/k-notes-frontend/public/locales/en/translation.json b/k-notes-frontend/public/locales/en/translation.json index 1a2bdb7..9697ac1 100644 --- a/k-notes-frontend/public/locales/en/translation.json +++ b/k-notes-frontend/public/locales/en/translation.json @@ -47,7 +47,13 @@ "Pinned": "Pinned", "Rename": "Rename", "Save changes": "Save changes", - "Saving...": "Saving...", + "Saving": { + "": { + "": { + "": "Saving..." + } + } + }, "Search your notes...": "Search your notes...", "Settings": "Settings", "Settings saved. Please refresh the page.": "Settings saved. Please refresh the page.", @@ -61,4 +67,4 @@ "Update": "Update", "work, todo, ideas": "work, todo, ideas", "Your notes will appear here. Click + to create one.": "Your notes will appear here. Click + to create one." -} \ No newline at end of file +} diff --git a/k-notes-frontend/public/locales/es/translation.json b/k-notes-frontend/public/locales/es/translation.json new file mode 100644 index 0000000..42aee1b --- /dev/null +++ b/k-notes-frontend/public/locales/es/translation.json @@ -0,0 +1,65 @@ +{ + "{{count}} selected_one": "{{count}} seleccionado", + "{{count}} selected_other": "{{count}} seleccionados", + "Add a new note to your collection.": "Añade una nueva nota a tu colección.", + "Archive": "Archivar", + "Archived {{count}} note_one": "{{count}} nota archivada", + "Archived {{count}} note_other": "{{count}} notas archivadas", + "Are you sure you want to delete {{count}} note?_one": "¿Estás seguro de que quieres eliminar {{count}} nota?", + "Are you sure you want to delete {{count}} note?_other": "¿Estás seguro de que quieres eliminar {{count}} notas?", + "Are you sure?": "¿Estás seguro?", + "Backend URL": "URL del backend", + "Color": "Color", + "Configure the application settings.": "Configura los ajustes de la aplicación.", + "Content": "Contenido", + "Create": "Crear", + "Create Note": "Crear nota", + "Data Management": "Gestión de datos", + "Delete": "Eliminar", + "Delete tag \"{{name}}\"? Notes will keep their content.": "¿Eliminar etiqueta \"{{name}}\"? Las notas conservarán su contenido.", + "Deleted {{count}} note_one": "{{count}} nota eliminada", + "Deleted {{count}} note_other": "{{count}} notas eliminadas", + "Edit Note": "Editar nota", + "Export Data": "Exportar datos", + "Export failed": "Exportación fallida", + "Export successful": "Exportación exitosa", + "Export your notes for backup or import from a JSON file.": "Exporta tus notas para hacer una copia de seguridad o importa desde un archivo JSON.", + "Grid View": "Vista de cuadrícula", + "History": "Historial", + "Import Data": "Importar datos", + "Import failed": "Importación fallida", + "Import successful. Reloading...": "Importación exitosa. Recargando...", + "Invalid URL": "URL inválida", + "K-Notes": "K-Notes", + "Language": "Idioma", + "List View": "Vista de lista", + "New Note": "Nueva nota", + "No archived notes yet": "Aún no hay notas archivadas", + "No matching notes found": "No se encontraron notas coincidentes", + "No notes with tag \"${activeTag}\"": "No hay notas con la etiqueta \"${activeTag}\"", + "No tags yet": "Aún no hay etiquetas", + "Note content... Type / for commands": "Contenido de la nota... Escribe / para ver comandos", + "Note created": "Nota creada", + "Note title": "Título de la nota", + "Note updated": "Nota actualizada", + "Notes": "Notas", + "Others": "Otros", + "Pin this note": "Fijar esta nota", + "Pinned": "Fijadas", + "Rename": "Renombrar", + "Save changes": "Guardar cambios", + "Saving...": "Guardando...", + "Search your notes...": "Busca tus notas...", + "Settings": "Configuración", + "Settings saved. Please refresh the page.": "Configuración guardada. Por favor, actualiza la página.", + "Tag deleted": "Etiqueta eliminada", + "Tag renamed": "Etiqueta renombrada", + "Tags": "Etiquetas", + "Tags (comma separated)": "Etiquetas (separadas por comas)", + "Title": "Título", + "Title is required": "El título es obligatorio", + "Title too long": "Título demasiado largo", + "Update": "Actualizar", + "work, todo, ideas": "trabajo, tareas, ideas", + "Your notes will appear here. Click + to create one.": "Tus notas aparecerán aquí. Haz clic en + para crear una." +} \ No newline at end of file diff --git a/k-notes-frontend/public/locales/fr/translation.json b/k-notes-frontend/public/locales/fr/translation.json new file mode 100644 index 0000000..9ee2788 --- /dev/null +++ b/k-notes-frontend/public/locales/fr/translation.json @@ -0,0 +1,65 @@ +{ + "{{count}} selected_one": "{{count}} sélectionné", + "{{count}} selected_other": "{{count}} sélectionnés", + "Add a new note to your collection.": "Ajoute une nouvelle note à ta collection.", + "Archive": "Archive", + "Archived {{count}} note_one": "{{count}} note archivée", + "Archived {{count}} note_other": "{{count}} notes archivées", + "Are you sure you want to delete {{count}} note?_one": "Es-tu sûr de vouloir supprimer {{count}} note ?", + "Are you sure you want to delete {{count}} note?_other": "Es-tu sûr de vouloir supprimer {{count}} notes ?", + "Are you sure?": "Es-tu sûr ?", + "Backend URL": "URL du backend", + "Color": "Couleur", + "Configure the application settings.": "Configure les paramètres de l'application.", + "Content": "Contenu", + "Create": "Créer", + "Create Note": "Créer une note", + "Data Management": "Gestion des données", + "Delete": "Supprimer", + "Delete tag \"{{name}}\"? Notes will keep their content.": "Supprimer l'étiquette \"{{name}}\" ? Les notes conserveront leur contenu.", + "Deleted {{count}} note_one": "{{count}} note supprimée", + "Deleted {{count}} note_other": "{{count}} notes supprimées", + "Edit Note": "Modifier la note", + "Export Data": "Exporter les données", + "Export failed": "Échec de l'exportation", + "Export successful": "Exportation réussie", + "Export your notes for backup or import from a JSON file.": "Exporte tes notes pour une sauvegarde ou importe depuis un fichier JSON.", + "Grid View": "Vue en grille", + "History": "Historique", + "Import Data": "Importer les données", + "Import failed": "Échec de l'importation", + "Import successful. Reloading...": "Importation réussie. Rechargement...", + "Invalid URL": "URL invalide", + "K-Notes": "K-Notes", + "Language": "Langue", + "List View": "Vue en liste", + "New Note": "Nouvelle note", + "No archived notes yet": "Pas encore de notes archivées", + "No matching notes found": "Aucune note correspondante trouvée", + "No notes with tag \"${activeTag}\"": "Aucune note avec l'étiquette \"${activeTag}\"", + "No tags yet": "Pas encore d'étiquettes", + "Note content... Type / for commands": "Contenu de la note... Tape / pour les commandes", + "Note created": "Note créée", + "Note title": "Titre de la note", + "Note updated": "Note mise à jour", + "Notes": "Notes", + "Others": "Autres", + "Pin this note": "Épingler cette note", + "Pinned": "Épinglées", + "Rename": "Renommer", + "Save changes": "Enregistrer les modifications", + "Saving...": "Enregistrement...", + "Search your notes...": "Recherche dans tes notes...", + "Settings": "Paramètres", + "Settings saved. Please refresh the page.": "Paramètres enregistrés. Veuillez actualiser la page.", + "Tag deleted": "Étiquette supprimée", + "Tag renamed": "Étiquette renommée", + "Tags": "Étiquettes", + "Tags (comma separated)": "Étiquettes (séparées par des virgules)", + "Title": "Titre", + "Title is required": "Le titre est requis", + "Title too long": "Titre trop long", + "Update": "Mettre à jour", + "work, todo, ideas": "travail, tâches, idées", + "Your notes will appear here. Click + to create one.": "Tes notes apparaîtront ici. Clique sur + pour en créer une." +} \ No newline at end of file diff --git a/k-notes-frontend/public/locales/pl/translation.json b/k-notes-frontend/public/locales/pl/translation.json index d01ce34..3f83ddc 100644 --- a/k-notes-frontend/public/locales/pl/translation.json +++ b/k-notes-frontend/public/locales/pl/translation.json @@ -50,13 +50,18 @@ "Note created": "Notatka utworzona", "Note title": "Tytuł notatki", "Note updated": "Notatka zaktualizowana", - "Notes": "Notatki", "Others": "Inne", "Pin this note": "Przypnij tę notatkę", "Pinned": "Przypięte", "Rename": "Zmień nazwę", "Save changes": "Zapisz zmiany", - "Saving...": "Zapisywanie...", + "Saving": { + "": { + "": { + "": "" + } + } + }, "Search your notes...": "Szukaj swoich notatek...", "Settings": "Ustawienia", "Settings saved. Please refresh the page.": "Ustawienia zapisane. Odśwież stronę.", @@ -70,4 +75,4 @@ "Update": "Aktualizuj", "work, todo, ideas": "praca, zadania, pomysły", "Your notes will appear here. Click + to create one.": "Twoje notatki pojawią się tutaj. Kliknij +, aby utworzyć notatkę." -} \ No newline at end of file +} diff --git a/k-notes-frontend/src/components/language-switcher.tsx b/k-notes-frontend/src/components/language-switcher.tsx index 0ff3a8f..e50b590 100644 --- a/k-notes-frontend/src/components/language-switcher.tsx +++ b/k-notes-frontend/src/components/language-switcher.tsx @@ -6,6 +6,9 @@ import { Languages } from "lucide-react"; const LANGUAGES = [ { code: "en", label: "English" }, { code: "pl", label: "Polski" }, + { code: "es", label: "Español" }, + { code: "de", label: "Deutsch" }, + { code: "fr", label: "Français" }, ]; export function LanguageSwitcher() { @@ -22,7 +25,7 @@ export function LanguageSwitcher() { {t("Language")} -
+
{LANGUAGES.map((lang) => (