diff --git a/messages/en.json b/messages/en.json index aaacec5..81d094e 100644 --- a/messages/en.json +++ b/messages/en.json @@ -3,6 +3,7 @@ "hello_world": "Hello, {name} from en!", "app_name": "Tracktor", "app_title": "Your Garage", + "app_new_update_available": "New Update is available. Reloading..!", "app_add_vehicle": "Add Vehicle", "app_empty_select_message": "Select a vehicle to view its details", "app_empty_select_hint": "Choose one from the garage above to load its dashboard.", @@ -448,5 +449,104 @@ "pollution_recurrence_type_fixed": "Fixed end date", "pollution_recurrence_type_yearly": "Renews yearly", "pollution_recurrence_type_monthly": "Renews monthly", - "pollution_recurrence_type_no_end": "No end date" + "pollution_recurrence_type_no_end": "No end date", + "file_drop_existing_note": "Existing attachment (Click to view)", + "fuel_import_step_1_title": "Step 1 : Upload CSV file", + "fuel_import_step_1_desc": "Select a delimited text file containing your fuel log data to begin the import process.", + "fuel_import_drop_placeholder": "Drop any delimited text file here, or click to browse", + "fuel_import_headers_checkbox": "First row contains headers", + "fuel_import_delimiter_title": "Delimiter", + "fuel_import_delimiter_desc": "Choose the character that separates fields", + "fuel_import_date_format_title": "Date Format", + "fuel_import_date_format_desc": "Specify the format used for dates in your CSV file.", + "fuel_import_error_no_headers": "No headers detected. Update csv.helper.ts to return headers.", + "fuel_import_step_2_title": "Step 2 : Map CSV columns", + "fuel_import_step_2_desc": "Map the columns from your CSV file to the corresponding fuel log fields. Required fields are marked with *.", + "fuel_import_step_3_title": "Step 3 : Preview & Import", + "fuel_import_step_3_desc": "Review a preview of the data to be imported.", + "fuel_import_no_preview": "No preview data yet. Implement parsing in csv.helper.ts to populate rows.", + "fuel_import_success": "Successfully imported {count} fuel log(s).", + "fuel_import_failed_count": "Imported {imported}, failed {failed}", + "fuel_import_error_generic": "Fuel log import failed.", + "fuel_import_vehicle_label": "Vehicle:", + "fuel_import_delimiter_comma": "Comma ( , )", + "fuel_import_delimiter_semicolon": "Semicolon ( ; )", + "fuel_import_delimiter_tab": "Tab ( \\t )", + "fuel_import_delimiter_pipe": "Pipe ( | )", + "fuel_import_delimiter_custom": "Custom", + "fuel_import_date_error": "Some rows have invalid dates for format \"{format}\"", + "fuel_import_date_format_placeholder": "e.g., MM/DD/YYYY", + "fuel_import_date_invalid": "Invalid date", + "fuel_import_no_vehicle": "No vehicle selected", + "fuel_import_col_date_hint": "Date of fuel refill", + "fuel_import_col_odometer_hint": "Reading at time of refill", + "fuel_import_col_fuel_hint": "Volume or energy charged", + "fuel_import_col_cost_hint": "Total cost for the entry", + "fuel_import_col_filled_hint": "Is this a full tank/charge?", + "fuel_import_col_missed_hint": "Was previous entry missed?", + "fuel_import_col_notes_hint": "Any extra notesss", + "autocomplete_placeholder": "Type or select...", + "autocomplete_loading": "Loading suggestions...", + "autocomplete_no_results": "No suggestions found. You can type a new value.", + "input_date_placeholder": "Pick a date", + "loading_default_message": "Loading...", + "dropzone_placeholder_image": "Click or drag image to upload", + "dropzone_placeholder_attachment": "Drop file here, or click to select", + "dropzone_placeholder_default": "Click or drag files to upload", + "dropzone_error_single_file": "Please upload only one file.", + "dropzone_error_file_size": "File size exceeds the maximum limit of {size}.", + "dropzone_unknown_file": "Unknown file", + "dropzone_uploading": "Uploading...", + "dropzone_supports": "Supports: {types}", + "dropzone_max_size": "Max size: {size}", + "dropzone_error_file_type": "File type not allowed", + "dropzone_hint_accept_limit": "{types} up to {size}", + "vehicle_details_color_aria": "Color", + "vehicle_details_close_aria": "Close", + "attachment_link_view_title": "View attachment", + "file_preview_not_available": "Preview not available", + "file_preview_download_hint": "This file type cannot be previewed directly. Please download it to view.", + "file_preview_download_button": "Download File", + "file_preview_aria_download": "Download", + "file_preview_aria_close": "Close", + "theme_toggle_label": "Toggle theme", + "fuel_log_edit": "Edit", + "fuel_log_delete": "Delete", + "fuel_log_menu_open": "Open menu", + "fuel_log_delete_success": "Deleted Fuel Log", + "fuel_log_menu_sheet_title": "Update Fuel Log", + "fuel_log_delete_error": "Some error occurred while deleting fuel log.", + "color_picker_label": "Choose a color", + "reminder_type_maintenance": "Maintenance", + "reminder_type_insurance": "Insurance Renewal", + "reminder_type_pollution": "Emission / PUCC", + "reminder_type_registration": "Registration / Tax", + "reminder_type_inspection": "Inspection", + "reminder_type_custom": "Custom", + "alert_type_insurance": "Insurance", + "alert_type_pucc": "Pollution Certificate", + "alert_status_expired_ago": "{label} expired {days} days ago", + "alert_status_expires_in": "{label} expires in {days} days", + "alert_status_valid_for": "{label} valid for {days} days", + "alert_insurance_active_no_end": "Insurance is active with no end date", + "alert_pucc_active_no_end": "PUCC is active with no end date", + "alert_record_not_found": "{label} record not found. Add details to stay compliant.", + "settings_error_format_not_valid": "Format not valid", + "common_kilogram_unit": "Kilogram (kg)", + "common_pound_unit": "Pound (lb)", + "settings_section_fuel_types": "Fuel types", + "settings_section_fuel_types_desc": "Choose the measurement for each fuel.", + "fuel_type_petrol_diesel": "Petrol/Diesel", + "theme_slate": "Slate", + "theme_stone": "Stone", + "theme_red": "Red", + "theme_rose": "Rose", + "theme_blue": "Blue", + "theme_green": "Green", + "theme_purple": "Purple", + "theme_orange": "Orange", + "theme_yellow": "Yellow", + "theme_teal": "Teal", + "theme_indigo": "Indigo", + "theme_pink": "Pink" } diff --git a/messages/hu.json b/messages/hu.json index f970541..65a8534 100644 --- a/messages/hu.json +++ b/messages/hu.json @@ -3,6 +3,7 @@ "hello_world": "Helló, {name}!", "app_name": "Tracktor", "app_title": "Járművek", + "app_new_update_available": "Új frissítés elérhető. Újratöltés..!", "app_add_vehicle": "Jármű hozzáadása", "app_empty_select_message": "Válassz egy járművet a részletek megtekintéséhez", "app_empty_select_hint": "Válassz egyet a fenti járművekből az irányítópult betöltéséhez!", @@ -448,5 +449,104 @@ "pollution_recurrence_type_fixed": "Rögzített lejárati dátum", "pollution_recurrence_type_yearly": "Évente megújuló", "pollution_recurrence_type_monthly": "Havonta megújuló", - "pollution_recurrence_type_no_end": "Nincs lejárati dátum" + "pollution_recurrence_type_no_end": "Nincs lejárati dátum", + "alert_insurance_active_no_end": "A biztosítás aktív, nincs lejárati dátum", + "alert_pucc_active_no_end": "A környezetvédelmi tanúsítvány aktív, nincs lejárati dátum", + "alert_record_not_found": "Nincs {label} adat. Adj meg részleteket a megfelelőség érdekében.", + "alert_status_expired_ago": "{label} lejárt {days} napja", + "alert_status_expires_in": "{label} lejár {days} nap múlva", + "alert_status_valid_for": "{label} érvényes még {days} napig", + "alert_type_insurance": "Biztosítás", + "alert_type_pucc": "Környezetvédelmi tanúsítvány", + "attachment_link_view_title": "Melléklet megtekintése", + "autocomplete_loading": "Javaslatok betöltése...", + "autocomplete_no_results": "Nincs találat. Írhatsz be új értéket.", + "autocomplete_placeholder": "Gépelj vagy válassz...", + "color_picker_label": "Válassz színt", + "common_kilogram_unit": "Kilogramm (kg)", + "common_pound_unit": "Font (lb)", + "dropzone_error_file_size": "A fájl mérete meghaladja a maximális {size} korlátot.", + "dropzone_error_single_file": "Kérlek, csak egy fájlt tölts fel.", + "dropzone_max_size": "Max méret: {size}", + "dropzone_placeholder_attachment": "Húzd ide a fájlt, vagy kattints a kiválasztáshoz", + "dropzone_placeholder_default": "Kattints vagy húzd ide a fájlokat a feltöltéshez", + "dropzone_placeholder_image": "Kattints vagy húzd ide a képet a feltöltéshez", + "dropzone_supports": "Támogatott: {types}", + "dropzone_unknown_file": "Ismeretlen fájl", + "dropzone_uploading": "Feltöltés...", + "dropzone_error_file_type": "Nem engedélyezett fájltípus", + "dropzone_hint_accept_limit": "{types} legfeljebb {size}", + "file_drop_existing_note": "Meglévő melléklet (Kattints a megtekintéshez)", + "file_preview_aria_close": "Bezárás", + "file_preview_aria_download": "Letöltés", + "file_preview_download_button": "Fájl letöltése", + "file_preview_download_hint": "Ez a fájltípus nem tekinthető meg közvetlenül. Kérlek, töltsd le a megtekintéshez.", + "file_preview_not_available": "Előnézet nem elérhető", + "fuel_import_col_cost_hint": "Teljes költség", + "fuel_import_col_date_hint": "Tankolás dátuma", + "fuel_import_col_filled_hint": "Tele tank/töltés?", + "fuel_import_col_fuel_hint": "Tankolt mennyiség vagy energia", + "fuel_import_col_missed_hint": "Előző bejegyzés kimaradt?", + "fuel_import_col_notes_hint": "Megjegyzések", + "fuel_import_col_odometer_hint": "Km-óra állás a tankoláskor", + "fuel_import_date_error": "Érvénytelen dátum", + "fuel_import_date_format_desc": "Add meg a dátum formátumát a CSV-ben", + "fuel_import_date_format_placeholder": "pl. YYYY-MM-DD", + "fuel_import_date_format_title": "Dátum formátum", + "fuel_import_date_invalid": "Érvénytelen dátum formátum", + "fuel_import_delimiter_comma": "Vessző (,)", + "fuel_import_delimiter_custom": "Egyéni", + "fuel_import_delimiter_desc": "Válaszd ki a CSV elválasztó karakterét", + "fuel_import_delimiter_pipe": "Függőleges vonal (|)", + "fuel_import_delimiter_semicolon": "Pontosvessző (;)", + "fuel_import_delimiter_tab": "Tabulátor", + "fuel_import_delimiter_title": "Elválasztó karakter", + "fuel_import_drop_placeholder": "Húzd ide a fájlt vagy kattints a kiválasztáshoz", + "fuel_import_error_generic": "Hiba történt az importálás során", + "fuel_import_error_no_headers": "A fejlécek nem találhatóak. Kérlek, ellenőrizd a fájlt.", + "fuel_import_failed_count": "Sikeres: {imported}, sikertelen: {failed}", + "fuel_import_headers_checkbox": "A fájl tartalmazzon fejléceket", + "fuel_import_no_preview": "Nincs elérhető előnézet", + "fuel_import_no_vehicle": "Nincs kiválasztott jármű", + "fuel_import_step_1_desc": "Válaszd ki a tankolási naplókat tartalmazó CSV fájlt", + "fuel_import_step_1_title": "CSV feltöltése", + "fuel_import_step_2_desc": "Párosítsd a CSV oszlopait a mezőkkel", + "fuel_import_step_2_title": "Oszlopok párosítása", + "fuel_import_step_3_desc": "Ellenőrizd az adatokat és importáld a tankolásokat", + "fuel_import_step_3_title": "Előnézet és importálás", + "fuel_import_success": "Sikeres importálás!", + "fuel_import_vehicle_label": "Jármű kiválasztása", + "fuel_log_delete": "Törlés", + "fuel_log_delete_error": "Hiba történt a tankolás törlése során.", + "fuel_log_delete_success": "Tankolás törölve", + "fuel_log_edit": "Szerkesztés", + "fuel_log_menu_open": "Menü megnyitása", + "fuel_log_menu_sheet_title": "Tankolás frissítése", + "fuel_type_petrol_diesel": "Benzin/Dízel", + "input_date_placeholder": "Válassz dátumot", + "loading_default_message": "Betöltés...", + "reminder_type_custom": "Egyéb", + "reminder_type_inspection": "Műszaki vizsga", + "reminder_type_insurance": "Biztosítás megújítás", + "reminder_type_maintenance": "Karbantartás", + "reminder_type_pollution": "Környezetvédelmi vizsgálat", + "reminder_type_registration": "Regisztráció / Adó", + "settings_error_format_not_valid": "Érvénytelen formátum", + "settings_section_fuel_types": "Üzemanyag típusok", + "settings_section_fuel_types_desc": "Válaszd ki a mértékegységet minden üzemanyaghoz.", + "theme_toggle_label": "Téma váltása", + "vehicle_details_close_aria": "Bezárás", + "vehicle_details_color_aria": "Szín", + "theme_slate": "Pala", + "theme_stone": "Kő", + "theme_red": "Piros", + "theme_rose": "Rózsa", + "theme_blue": "Kék", + "theme_green": "Zöld", + "theme_purple": "Lila", + "theme_orange": "Narancs", + "theme_yellow": "Sárga", + "theme_teal": "Türkiz", + "theme_indigo": "Indigó", + "theme_pink": "Rózsaszín" } diff --git a/src/lib/components/app/AutocompleteInput.svelte b/src/lib/components/app/AutocompleteInput.svelte index 1769212..d9193e2 100644 --- a/src/lib/components/app/AutocompleteInput.svelte +++ b/src/lib/components/app/AutocompleteInput.svelte @@ -2,6 +2,7 @@ import type { HTMLInputAttributes } from 'svelte/elements'; import { cn, type WithElementRef } from '$lib/utils.js'; import type { Component } from 'svelte'; + import * as m from '$lib/paraglide/messages'; type Props = WithElementRef< HTMLInputAttributes & { @@ -18,7 +19,7 @@ suggestions = [], loading = false, class: className, - placeholder = 'Type or select...', + placeholder = m.autocomplete_placeholder(), ...restProps }: Props = $props(); @@ -104,7 +105,7 @@ class="bg-popover text-popover-foreground absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-md border shadow-md" > {#if loading} -
Loading suggestions...
+
{m.autocomplete_loading()}
{:else if filteredSuggestions.length > 0}
{#each filteredSuggestions as suggestion (suggestion)} @@ -122,7 +123,7 @@
{:else}
- No suggestions found. You can type a new value. + {m.autocomplete_no_results()}
{/if} diff --git a/src/lib/components/app/FileDropZone.svelte b/src/lib/components/app/FileDropZone.svelte index 63be627..3ce2495 100644 --- a/src/lib/components/app/FileDropZone.svelte +++ b/src/lib/components/app/FileDropZone.svelte @@ -13,6 +13,7 @@ import X from '@lucide/svelte/icons/x'; import FileText from '@lucide/svelte/icons/file-text'; import Image from '@lucide/svelte/icons/image'; + import * as m from '$lib/paraglide/messages'; import AttachmentLink from '$lib/components/app/AttachmentLink.svelte'; @@ -61,10 +62,10 @@ const effectivePlaceholder = $derived( placeholder || (variant === 'image' - ? 'Click or drag image to upload' + ? m.dropzone_placeholder_image() : variant === 'attachment' - ? 'Drop file here, or click to select' - : 'Click or drag files to upload') + ? m.dropzone_placeholder_attachment() + : m.dropzone_placeholder_default()) ); $effect(() => { @@ -108,7 +109,7 @@ const droppedFiles = Array.from(e.dataTransfer?.files ?? []); if (droppedFiles.length > 1) { - toast.error('Please upload only one file.'); + toast.error(m.dropzone_error_single_file()); return; } @@ -123,7 +124,7 @@ const selectedFiles = e.currentTarget.files; if (!selectedFiles || selectedFiles.length !== 1 || selectedFiles.item(0) === null) { - toast.error('Please upload only one file.'); + toast.error(m.dropzone_error_single_file()); return; } else { await upload(selectedFiles.item(0)); @@ -136,7 +137,7 @@ const shouldAcceptFile = (file: File): boolean => { // Check file size if (maxFileSize && file.size > maxFileSize) { - toast.error(`File size exceeds the maximum limit of ${displaySize(maxFileSize)}.`); + toast.error(m.dropzone_error_file_size({ size: displaySize(maxFileSize) })); return false; } @@ -162,7 +163,7 @@ }); if (!isAcceptable) { - toast.error('File type not allowed. Please upload a supported file type.'); + toast.error(m.dropzone_error_file_type()); return false; } @@ -211,7 +212,7 @@ file ? file.name : effectiveExistingUrl && !removeExisting - ? effectiveExistingUrl.split('/').pop() || 'Unknown file' + ? effectiveExistingUrl.split('/').pop() || m.dropzone_unknown_file() : null ); @@ -267,7 +268,7 @@

- Existing attachment (Click to view) + {m.file_drop_existing_note()}

{/if} @@ -313,7 +314,10 @@ {effectivePlaceholder} - {accept.replace(/,/g, ', ')} up to {displaySize(maxFileSize)} + {m.dropzone_hint_accept_limit({ + types: accept.replace(/,/g, ', '), + size: displaySize(maxFileSize) + })} @@ -328,17 +332,17 @@ id="file-upload-spinner" class="border-primary h-8 w-8 animate-spin rounded-full border-b-2" > -

Uploading...

+

{m.dropzone_uploading()}

{:else}

{effectivePlaceholder}

{#if variant !== 'image'}

- Supports: {accept.replace(/,/g, ', ')} + {m.dropzone_supports({ types: accept.replace(/,/g, ', ') })}

{#if maxFileSize}

- Max size: {displaySize(maxFileSize)} + {m.dropzone_max_size({ size: displaySize(maxFileSize) })}

{/if} {/if} diff --git a/src/lib/components/app/FilePreviewModal.svelte b/src/lib/components/app/FilePreviewModal.svelte index d5dcad3..33c91c3 100644 --- a/src/lib/components/app/FilePreviewModal.svelte +++ b/src/lib/components/app/FilePreviewModal.svelte @@ -8,6 +8,7 @@ import Skeleton from '$lib/components/ui/skeleton/skeleton.svelte'; import { cn } from '$lib/utils'; import { scale } from 'svelte/transition'; + import * as m from '$lib/paraglide/messages'; let { open = $bindable(false), @@ -87,7 +88,7 @@ download={fileName} > - Download + {m.file_preview_aria_download()} @@ -137,14 +138,14 @@
-

Preview not available

+

{m.file_preview_not_available()}

- This file type cannot be previewed directly. Please download it to view. + {m.file_preview_download_hint()}

{/if} diff --git a/src/lib/components/app/ThemeToggle.svelte b/src/lib/components/app/ThemeToggle.svelte index f8e4b61..c1119c2 100644 --- a/src/lib/components/app/ThemeToggle.svelte +++ b/src/lib/components/app/ThemeToggle.svelte @@ -1,6 +1,7 @@