diff --git a/client/src/pages/Alerts.jsx b/client/src/pages/Alerts.jsx index e6561a7..8573e70 100644 --- a/client/src/pages/Alerts.jsx +++ b/client/src/pages/Alerts.jsx @@ -1334,7 +1334,7 @@ const AlertDetailsModal = ({ alert, parseErrorMessage, onClose }) => {
{alert.recipient}
- Retry Count: + {t('alerts.retryCount')}:
{alert.retry_count}
diff --git a/client/src/pages/Detections.jsx b/client/src/pages/Detections.jsx index a3820b8..9206511 100644 --- a/client/src/pages/Detections.jsx +++ b/client/src/pages/Detections.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import api from '../services/api'; import { format } from 'date-fns'; import { formatFrequency } from '../utils/formatFrequency'; -import { t } from '../utils/tempTranslations'; // Temporary translation system +import { useTranslation } from '../utils/tempTranslations'; import { MagnifyingGlassIcon, FunnelIcon, @@ -10,6 +10,7 @@ import { } from '@heroicons/react/24/outline'; const Detections = () => { + const { t } = useTranslation(); const [detections, setDetections] = useState([]); const [loading, setLoading] = useState(true); const [pagination, setPagination] = useState({}); @@ -85,7 +86,7 @@ const Detections = () => { {t('detections.title')}

- History of all drone detections from your devices + {t('detections.description')}

@@ -103,12 +104,12 @@ const Detections = () => {
handleFilterChange('device_id', e.target.value)} /> @@ -116,12 +117,12 @@ const Detections = () => {
handleFilterChange('drone_id', e.target.value)} /> @@ -129,7 +130,7 @@ const Detections = () => {
{
{ onClick={clearFilters} className="btn btn-secondary" > - Clear Filters + {t('detections.clearFilters')}
@@ -175,14 +176,14 @@ const Detections = () => { - - - - - - - - + + + + + + + + @@ -231,7 +232,7 @@ const Detections = () => { {detection.device?.location_description || (detection.geo_lat && detection.geo_lon ? `${detection.geo_lat}, ${detection.geo_lon}` : - 'Unknown')} + t('detections.unknown'))}
DeviceDrone IDTypeFrequencyRSSILocationDetected AtActions{t('detections.device')}{t('detections.droneId')}{t('detections.type')}{t('detections.frequency')}{t('detections.rssi')}{t('detections.location')}{t('detections.detectedAt')}{t('detections.actions')}
@@ -264,7 +265,7 @@ const Detections = () => {

{t('detections.noDetections')}

- Try adjusting your search filters. + {t('detections.tryAdjustingFilters')}

)} @@ -278,29 +279,29 @@ const Detections = () => { disabled={filters.offset === 0} className="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50" > - Previous + {t('detections.previous')}

- Showing{' '} + {t('detections.showing')} {' '} {filters.offset + 1} - {' '}to{' '} + {' '}{t('detections.to')}{' '} {Math.min(filters.offset + filters.limit, pagination.total)} - {' '}of{' '} + {' '}{t('detections.of')}{' '} {pagination.total} - {' '}results + {' '}{t('detections.results')}

@@ -311,14 +312,14 @@ const Detections = () => { disabled={filters.offset === 0} className="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:opacity-50" > - Previous + {t('detections.previous')}
diff --git a/client/src/utils/tempTranslations.js b/client/src/utils/tempTranslations.js index 6003538..29cf05f 100644 --- a/client/src/utils/tempTranslations.js +++ b/client/src/utils/tempTranslations.js @@ -89,7 +89,26 @@ const translations = { showOnMap: 'Show on Map', highConfidence: 'High Confidence', mediumConfidence: 'Medium Confidence', - lowConfidence: 'Low Confidence' + lowConfidence: 'Low Confidence', + filters: 'Filters', + deviceId: 'Device ID', + droneId: 'Drone ID', + startDate: 'Start Date', + endDate: 'End Date', + clearFilters: 'Clear Filters', + deviceIdPlaceholder: 'Enter device ID', + droneIdPlaceholder: 'Enter drone ID', + frequency: 'Frequency', + rssi: 'RSSI', + detectedAt: 'Detected At', + unknown: 'Unknown', + tryAdjustingFilters: 'Try adjusting your search filters.', + previous: 'Previous', + next: 'Next', + showing: 'Showing', + to: 'to', + of: 'of', + results: 'results' }, devices: { title: 'All Devices', @@ -323,7 +342,7 @@ const translations = { multipleContacts: 'Multiple Contacts', noDevicesFound: 'No devices found', mapLegend: 'Map Legend', - deviceDetecting: 'Device Detecting', + deviceDetecting: 'Active Detection', droneDetectionRings: 'Drone Detection Rings', ringsDescription: 'Rings show estimated detection range based on RSSI', orlanMilitary: 'Military-drone (Always Critical)', @@ -512,6 +531,7 @@ const translations = { channel: 'Channel', channels: 'Channels', status: 'Status', + retryCount: 'Retry Count', message: 'Message', detectionDetails: 'Detection Details', viewDetails: 'View Details', @@ -769,7 +789,26 @@ const translations = { showOnMap: 'Visa på karta', highConfidence: 'Hög säkerhet', mediumConfidence: 'Medel säkerhet', - lowConfidence: 'Låg säkerhet' + lowConfidence: 'Låg säkerhet', + filters: 'Filter', + deviceId: 'Enhets-ID', + droneId: 'Drönare-ID', + startDate: 'Startdatum', + endDate: 'Slutdatum', + clearFilters: 'Rensa filter', + deviceIdPlaceholder: 'Ange enhets-ID', + droneIdPlaceholder: 'Ange drönare-ID', + frequency: 'Frekvens', + rssi: 'RSSI', + detectedAt: 'Detekterad vid', + unknown: 'Okänd', + tryAdjustingFilters: 'Försök justera dina sökfilter.', + previous: 'Föregående', + next: 'Nästa', + showing: 'Visar', + to: 'till', + of: 'av', + results: 'resultat' }, devices: { title: 'Alla enheter', @@ -1003,7 +1042,7 @@ const translations = { multipleContacts: 'Flera kontakter', noDevicesFound: 'Inga enheter hittades', mapLegend: 'Kartteckenförklaring', - deviceDetecting: 'Enhet detekterar', + deviceDetecting: 'Aktiv detektion', droneDetectionRings: 'Drönardetekteringsringar', ringsDescription: 'Ringar visar uppskattad detekteringsräckvidd baserat på RSSI', orlanMilitary: 'Militärdrönare (Alltid kritisk)', @@ -1192,6 +1231,7 @@ const translations = { channel: 'Kanal', channels: 'Kanaler', status: 'Status', + retryCount: 'Antal återförsök', message: 'Meddelande', detectionDetails: 'Detekteringsdetaljer', viewDetails: 'Visa detaljer',