Skip to content

Commit 907bd3a

Browse files
committed
feat(i18n): add translations for file import flow
- Add strings for upload, preview errors, progress, and results - Provide German, English, Spanish and French localizations - Wire keys used across import components and modal
1 parent c7110a5 commit 907bd3a

File tree

5 files changed

+209
-1
lines changed

5 files changed

+209
-1
lines changed

messages/de-DE.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@
5252
"myGroups": "Meine Gruppen",
5353
"create": "Erstellen",
5454
"loadingRecent": "Lade letzte Gruppen…",
55+
"CreateOptions": {
56+
"openMenu": "Erstelloptionen öffnen",
57+
"newGroup": "Neue Gruppe",
58+
"importFromFile": "Aus Datei importieren"
59+
},
60+
"ImportDialog": {
61+
"successTitle": "Gruppe erstellt",
62+
"successDescription": "Gruppe {name} wurde aus dem Import erstellt."
63+
},
5564
"NoRecent": {
5665
"description": "Du hast in der letzten Zeit keine Gruppe besucht.",
5766
"create": "Erstelle eine",
@@ -456,4 +465,47 @@
456465
"heading": "Geläufigste"
457466
}
458467
}
468+
,
469+
"FileImport": {
470+
"title": "Gruppe aus Datei importieren",
471+
"buttonLabel": "Import-Dialog öffnen",
472+
"errorTitle": "Fehler",
473+
"processing": "Verarbeite…",
474+
"fileLabel": "Datei auswählen",
475+
"uploadDragTitle": "Datei hier ablegen oder klicken, um auszuwählen",
476+
"uploadDragDescription": "Unterstützt: JSON (Spliit-JSON) und Debug-Dateien",
477+
"fileReadError": "Die ausgewählte Datei konnte nicht gelesen werden.",
478+
"newGroupNameLabel": "Name der neuen Gruppe",
479+
"newGroupNamePlaceholder": "Gruppennamen eingeben (optional)",
480+
"analysisAwaiting": "Warte auf Datei-Analyse…",
481+
"analysisExplanation": "Wähle eine Datei, um sie vor dem Import zu analysieren.",
482+
"previewErrorTitle": "Die Datei konnte nicht analysiert werden",
483+
"generalInfoTitle": "Allgemeine Informationen",
484+
"generalInfoFormat": "Format",
485+
"generalInfoRows": "Zeilen",
486+
"generalInfoInvalidRows": "Ungültige Zeilen",
487+
"generalInfoTotal": "Gesamtbetrag",
488+
"generalInfoParticipants": "Teilnehmer und Salden",
489+
"generalInfoParticipantsEmpty": "Keine Teilnehmerinformationen erkannt.",
490+
"generalInfoUnknown": "Unbekannt",
491+
"analysisHeaderTitle": "Probleme im Header",
492+
"analysisGeneralWarningsTitle": "Allgemeine Warnungen",
493+
"analysisCategoryTitle": "Kategorie-Zuordnungswarnungen",
494+
"analysisErrorsTitle": "Zeilenfehler",
495+
"analysisFatalHint": "Behebe diese Fehler, um den Import zu aktivieren.",
496+
"import": "Importieren",
497+
"importing": "Importiere…",
498+
"importProgressLabel": "Importiere Ausgaben",
499+
"importCancel": "Import abbrechen",
500+
"importCanceling": "Breche ab…",
501+
"importResultCompleted": "{created} von {total} Zeilen importiert",
502+
"importResultCancelledSimple": "Import abgebrochen",
503+
"importResultConfirm": "Weiter"
504+
},
505+
"FileImportErrors": {
506+
"noParticipants": "Keine Teilnehmer in der Datei definiert.",
507+
"fileEmpty": "Die hochgeladene Datei war leer.",
508+
"invalidAmount": "Ungültiger Betrag in einer oder mehreren Zeilen.",
509+
"invalidDate": "Ungültiges Ausgabedatum in einer oder mehreren Zeilen."
510+
}
459511
}

messages/en-US.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@
5252
"myGroups": "My groups",
5353
"create": "Create",
5454
"loadingRecent": "Loading recent groups…",
55+
"CreateOptions": {
56+
"openMenu": "Open create options",
57+
"newGroup": "New group",
58+
"importFromFile": "Import from file"
59+
},
60+
"ImportDialog": {
61+
"successTitle": "Group created",
62+
"successDescription": "Group {name} was created from import."
63+
},
5564
"NoRecent": {
5665
"description": "You have not visited any group recently.",
5766
"create": "Create one",
@@ -449,4 +458,47 @@
449458
"heading": "Other currencies"
450459
}
451460
}
461+
,
462+
"FileImport": {
463+
"title": "Import group from file",
464+
"buttonLabel": "Open import dialog",
465+
"errorTitle": "Error",
466+
"processing": "Processing…",
467+
"fileLabel": "Select a file",
468+
"uploadDragTitle": "Drop a file here or click to select",
469+
"uploadDragDescription": "Supported: JSON (Spliit-JSON) and debug files",
470+
"fileReadError": "Could not read the selected file.",
471+
"newGroupNameLabel": "New group name",
472+
"newGroupNamePlaceholder": "Enter a group name (optional)",
473+
"analysisAwaiting": "Awaiting file analysis…",
474+
"analysisExplanation": "Select a file to analyze its content before importing.",
475+
"previewErrorTitle": "We couldn't analyze your file",
476+
"generalInfoTitle": "General information",
477+
"generalInfoFormat": "Format",
478+
"generalInfoRows": "Rows",
479+
"generalInfoInvalidRows": "Invalid rows",
480+
"generalInfoTotal": "Total amount",
481+
"generalInfoParticipants": "Participants and balances",
482+
"generalInfoParticipantsEmpty": "No participant information detected.",
483+
"generalInfoUnknown": "Unknown",
484+
"analysisHeaderTitle": "Header issues",
485+
"analysisGeneralWarningsTitle": "General warnings",
486+
"analysisCategoryTitle": "Category mapping warnings",
487+
"analysisErrorsTitle": "Row errors",
488+
"analysisFatalHint": "Fix these errors to enable import.",
489+
"import": "Import",
490+
"importing": "Importing…",
491+
"importProgressLabel": "Importing expenses",
492+
"importCancel": "Cancel import",
493+
"importCanceling": "Cancelling…",
494+
"importResultCompleted": "Imported {created} of {total} rows",
495+
"importResultCancelledSimple": "Import cancelled",
496+
"importResultConfirm": "Continue"
497+
},
498+
"FileImportErrors": {
499+
"noParticipants": "No participants defined in file.",
500+
"fileEmpty": "The uploaded file was empty.",
501+
"invalidAmount": "Invalid amount in one or more rows.",
502+
"invalidDate": "Invalid expense date in one or more rows."
503+
}
452504
}

messages/es.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@
5252
"myGroups": "Mis grupos",
5353
"create": "Crear",
5454
"loadingRecent": "Cargando grupos recientes…",
55+
"CreateOptions": {
56+
"openMenu": "Abrir opciones de creación",
57+
"newGroup": "Nuevo grupo",
58+
"importFromFile": "Importar desde archivo"
59+
},
60+
"ImportDialog": {
61+
"successTitle": "Grupo creado",
62+
"successDescription": "El grupo {name} se creó a partir de la importación."
63+
},
5564
"NoRecent": {
5665
"description": "No has visitado ningun grupo recientemente.",
5766
"create": "Crea uno",
@@ -448,4 +457,47 @@
448457
"heading": "Otras monedas"
449458
}
450459
}
460+
,
461+
"FileImport": {
462+
"title": "Importar grupo desde archivo",
463+
"buttonLabel": "Abrir diálogo de importación",
464+
"errorTitle": "Error",
465+
"processing": "Procesando…",
466+
"fileLabel": "Seleccionar un archivo",
467+
"uploadDragTitle": "Suelta un archivo aquí o haz clic para seleccionar",
468+
"uploadDragDescription": "Compatible: JSON (Spliit‑JSON) y archivos de depuración",
469+
"fileReadError": "No se pudo leer el archivo seleccionado.",
470+
"newGroupNameLabel": "Nombre del nuevo grupo",
471+
"newGroupNamePlaceholder": "Introduce un nombre de grupo (opcional)",
472+
"analysisAwaiting": "Esperando el análisis del archivo…",
473+
"analysisExplanation": "Selecciona un archivo para analizar su contenido antes de importar.",
474+
"previewErrorTitle": "No pudimos analizar tu archivo",
475+
"generalInfoTitle": "Información general",
476+
"generalInfoFormat": "Formato",
477+
"generalInfoRows": "Filas",
478+
"generalInfoInvalidRows": "Filas inválidas",
479+
"generalInfoTotal": "Monto total",
480+
"generalInfoParticipants": "Participantes y saldos",
481+
"generalInfoParticipantsEmpty": "No se detectó información de participantes.",
482+
"generalInfoUnknown": "Desconocido",
483+
"analysisHeaderTitle": "Problemas en el encabezado",
484+
"analysisGeneralWarningsTitle": "Advertencias generales",
485+
"analysisCategoryTitle": "Advertencias de categorías",
486+
"analysisErrorsTitle": "Errores por fila",
487+
"analysisFatalHint": "Corrige estos errores para habilitar la importación.",
488+
"import": "Importar",
489+
"importing": "Importando…",
490+
"importProgressLabel": "Importando gastos",
491+
"importCancel": "Cancelar importación",
492+
"importCanceling": "Cancelando…",
493+
"importResultCompleted": "{created} de {total} filas importadas",
494+
"importResultCancelledSimple": "Importación cancelada",
495+
"importResultConfirm": "Continuar"
496+
},
497+
"FileImportErrors": {
498+
"noParticipants": "No hay participantes definidos en el archivo.",
499+
"fileEmpty": "El archivo subido estaba vacío.",
500+
"invalidAmount": "Monto inválido en una o más filas.",
501+
"invalidDate": "Fecha de gasto inválida en una o más filas."
502+
}
451503
}

messages/fr-FR.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@
5252
"myGroups": "Mes groupes",
5353
"create": "Créer",
5454
"loadingRecent": "Chargement des groupes récents…",
55+
"CreateOptions": {
56+
"openMenu": "Ouvrir les options de création",
57+
"newGroup": "Nouveau groupe",
58+
"importFromFile": "Importer depuis un fichier"
59+
},
60+
"ImportDialog": {
61+
"successTitle": "Groupe créé",
62+
"successDescription": "Le groupe {name} a été créé à partir de l'import."
63+
},
5564
"NoRecent": {
5665
"description": "Vous n'avez visité aucun groupe récemment.",
5766
"create": "Créer un groupe",
@@ -456,4 +465,47 @@
456465
"heading": "Autres devises"
457466
}
458467
}
468+
,
469+
"FileImport": {
470+
"title": "Importer un groupe depuis un fichier",
471+
"buttonLabel": "Ouvrir la boîte d'import",
472+
"errorTitle": "Erreur",
473+
"processing": "Traitement…",
474+
"fileLabel": "Sélectionner un fichier",
475+
"uploadDragTitle": "Déposez un fichier ici ou cliquez pour sélectionner",
476+
"uploadDragDescription": "Pris en charge : JSON (Spliit‑JSON) et fichiers de débogage",
477+
"fileReadError": "Impossible de lire le fichier sélectionné.",
478+
"newGroupNameLabel": "Nom du nouveau groupe",
479+
"newGroupNamePlaceholder": "Entrez un nom de groupe (optionnel)",
480+
"analysisAwaiting": "En attente de l'analyse du fichier…",
481+
"analysisExplanation": "Sélectionnez un fichier pour analyser son contenu avant l'import.",
482+
"previewErrorTitle": "Nous n'avons pas pu analyser votre fichier",
483+
"generalInfoTitle": "Informations générales",
484+
"generalInfoFormat": "Format",
485+
"generalInfoRows": "Lignes",
486+
"generalInfoInvalidRows": "Lignes invalides",
487+
"generalInfoTotal": "Montant total",
488+
"generalInfoParticipants": "Participants et soldes",
489+
"generalInfoParticipantsEmpty": "Aucune information de participant détectée.",
490+
"generalInfoUnknown": "Inconnu",
491+
"analysisHeaderTitle": "Problèmes d'en‑tête",
492+
"analysisGeneralWarningsTitle": "Avertissements généraux",
493+
"analysisCategoryTitle": "Avertissements de catégorisation",
494+
"analysisErrorsTitle": "Erreurs de lignes",
495+
"analysisFatalHint": "Corrigez ces erreurs pour activer l'import.",
496+
"import": "Importer",
497+
"importing": "Importation…",
498+
"importProgressLabel": "Import des dépenses",
499+
"importCancel": "Annuler l'import",
500+
"importCanceling": "Annulation…",
501+
"importResultCompleted": "{created} sur {total} lignes importées",
502+
"importResultCancelledSimple": "Import annulé",
503+
"importResultConfirm": "Continuer"
504+
},
505+
"FileImportErrors": {
506+
"noParticipants": "Aucun participant défini dans le fichier.",
507+
"fileEmpty": "Le fichier téléchargé était vide.",
508+
"invalidAmount": "Montant invalide dans une ou plusieurs lignes.",
509+
"invalidDate": "Date de dépense invalide dans une ou plusieurs lignes."
510+
}
459511
}

src/lib/imports/spliit-json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class SpliitJsonFormat implements ImportFormat {
217217
) => ({
218218
expenseDate: coerceDate(e?.expenseDate),
219219
title: String(e?.title ?? '').trim() || `Expense ${index + 1}`,
220-
category: 0,
220+
category: resolveCategoryId(e?.categoryId ?? e?.category),
221221
amount: Math.round(coerceNumber(e?.amount, 'amount')),
222222
originalAmount:
223223
e?.originalAmount != null

0 commit comments

Comments
 (0)