From 9e9a6e27ffe023f04ef1262abc28456b5d0c6f36 Mon Sep 17 00:00:00 2001 From: David Scheidt Date: Tue, 13 Jan 2026 15:58:26 +0100 Subject: [PATCH 01/11] feat: reenable column navigation --- app/components/mydevices/dt/columns.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/mydevices/dt/columns.tsx b/app/components/mydevices/dt/columns.tsx index 20c09175..d19b48e9 100644 --- a/app/components/mydevices/dt/columns.tsx +++ b/app/components/mydevices/dt/columns.tsx @@ -126,7 +126,7 @@ export function getColumns( {t('edit')} - + {t('data_upload')} From 2cbbc8efe7f6a2d2b2034528fee6ea6b4231bf51 Mon Sep 17 00:00:00 2001 From: David Scheidt Date: Tue, 13 Jan 2026 15:58:33 +0100 Subject: [PATCH 02/11] feat: add translation file --- app/routes/device.$deviceId.dataupload.tsx | 11 +++++------ public/locales/de/common.json | 3 ++- public/locales/de/csv-upload.json | 1 + public/locales/en/common.json | 3 ++- public/locales/en/csv-upload.json | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 public/locales/de/csv-upload.json create mode 100644 public/locales/en/csv-upload.json diff --git a/app/routes/device.$deviceId.dataupload.tsx b/app/routes/device.$deviceId.dataupload.tsx index 6b8c5ed3..a76f0d20 100644 --- a/app/routes/device.$deviceId.dataupload.tsx +++ b/app/routes/device.$deviceId.dataupload.tsx @@ -1,5 +1,6 @@ import { ArrowLeft, Upload } from 'lucide-react' import { useState } from 'react' +import { useTranslation } from 'react-i18next' import { redirect, Form, Link, type LoaderFunctionArgs } from 'react-router' import ErrorMessage from '~/components/error-message' import { NavBar } from '~/components/nav-bar' @@ -16,7 +17,6 @@ import { import { Textarea } from '~/components/ui/textarea' import { getUserId } from '~/utils/session.server' -//***************************************************** export async function loader({ request }: LoaderFunctionArgs) { //* if user is not logged in, redirect to home const userId = await getUserId(request) @@ -25,18 +25,17 @@ export async function loader({ request }: LoaderFunctionArgs) { return {} } -//***************************************************** export async function action() { return {} } -//********************************** export default function DataUpload() { + const { t } = useTranslation('csv-upload') const [measurementData, setMeasurementData] = useState('') const [dataFormat, setDataFormat] = useState('CSV') return ( -
+
@@ -44,8 +43,8 @@ export default function DataUpload() { diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 124dc601..502e899d 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -1,3 +1,4 @@ { - "greeting": "Hallo" + "greeting": "Hallo", + "backToDashboardNavText": "Zurück zum Dashboard" } diff --git a/public/locales/de/csv-upload.json b/public/locales/de/csv-upload.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/public/locales/de/csv-upload.json @@ -0,0 +1 @@ +{} diff --git a/public/locales/en/common.json b/public/locales/en/common.json index f750bd11..75d33155 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -1,3 +1,4 @@ { - "greeting": "Hello" + "greeting": "Hello", + "backToDashboardNavText": "Back to Dashboard" } diff --git a/public/locales/en/csv-upload.json b/public/locales/en/csv-upload.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/public/locales/en/csv-upload.json @@ -0,0 +1 @@ +{} From 3e54e4dfb7827507da415ca8fdc03d9cead20e0b Mon Sep 17 00:00:00 2001 From: David Scheidt Date: Tue, 13 Jan 2026 16:49:53 +0100 Subject: [PATCH 03/11] fix: translate csv upload view --- app/i18next-options.ts | 22 +++++----- app/routes/device.$deviceId.dataupload.tsx | 50 +++++++++++++--------- public/locales/de/csv-upload.json | 10 ++++- public/locales/en/csv-upload.json | 10 ++++- 4 files changed, 58 insertions(+), 34 deletions(-) diff --git a/app/i18next-options.ts b/app/i18next-options.ts index c31dfd37..ace7c1af 100644 --- a/app/i18next-options.ts +++ b/app/i18next-options.ts @@ -1,13 +1,13 @@ -export const supportedLanguages = ["en", "de"] as const; +export const supportedLanguages = ['en', 'de'] as const export default { - // This is the list of languages your application supports - supportedLngs: supportedLanguages, - // This is the language you want to use in case - // if the user language is not in the supportedLngs - fallbackLng: "en", - // The default namespace of i18next is "translation", but you can customize it here - defaultNS: "common", - // Disabling suspense is recommended - react: { useSuspense: false }, -}; + // This is the list of languages your application supports + supportedLngs: supportedLanguages, + // This is the language you want to use in case + // if the user language is not in the supportedLngs + fallbackLng: 'en', + // The default namespace of i18next is "translation", but you can customize it here + defaultNS: 'common', + // Disabling suspense is recommended + react: { useSuspense: false }, +} diff --git a/app/routes/device.$deviceId.dataupload.tsx b/app/routes/device.$deviceId.dataupload.tsx index a76f0d20..c68f4a82 100644 --- a/app/routes/device.$deviceId.dataupload.tsx +++ b/app/routes/device.$deviceId.dataupload.tsx @@ -1,6 +1,6 @@ import { ArrowLeft, Upload } from 'lucide-react' import { useState } from 'react' -import { useTranslation } from 'react-i18next' +import { Trans, useTranslation } from 'react-i18next' import { redirect, Form, Link, type LoaderFunctionArgs } from 'react-router' import ErrorMessage from '~/components/error-message' import { NavBar } from '~/components/nav-bar' @@ -30,7 +30,7 @@ export async function action() { } export default function DataUpload() { - const { t } = useTranslation('csv-upload') + const { t } = useTranslation(['csv-upload', 'common']) const [measurementData, setMeasurementData] = useState('') const [dataFormat, setDataFormat] = useState('CSV') @@ -44,7 +44,9 @@ export default function DataUpload() {
  • - {t('backToDashboardNavText')} + + {t('common:backToDashboardNavText')} +
@@ -52,22 +54,26 @@ export default function DataUpload() {
-

Manual Data Upload

+

+ {t('dataUploadHeading')} +

- Here you can upload measurements for this senseBox. This can - be of use for senseBoxes that log their measurements to an - SD card when no means of direct communication to - openSenseMap are available. Either select a file, or copy - the data into the text field. Accepted data formats are - described{' '} - - here - - . + + Here you can upload measurements for this senseBox. This + can be of use for senseBoxes that log their measurements + to an SD card when no means of direct communication to + openSenseMap are available. Either select a file, or copy + the data into the text field. Accepted data formats are + described{' '} + + here + + . +

@@ -80,7 +86,7 @@ export default function DataUpload() { htmlFor="fileInput" className="flex h-full w-full cursor-pointer items-center justify-center" > - Upload File + {t('uploadFileLabel')}