diff --git a/src/components/KeyBackupReminder.tsx b/src/components/KeyBackupReminder.tsx
index aefe60ec..32cacd1a 100644
--- a/src/components/KeyBackupReminder.tsx
+++ b/src/components/KeyBackupReminder.tsx
@@ -7,7 +7,7 @@ export const KeyBackupReminder = () => {
const { t } = useTranslation("dialog");
useBackupReminder({
- message: t("pkiBackup.description"),
+ message: t("pkiBackupReminder.description"),
onAccept: () => setDialogOpen("pkiBackup", true),
enabled: true,
});
diff --git a/src/core/hooks/useKeyBackupReminder.tsx b/src/core/hooks/useKeyBackupReminder.tsx
index 9e71c2fa..eaadce14 100644
--- a/src/core/hooks/useKeyBackupReminder.tsx
+++ b/src/core/hooks/useKeyBackupReminder.tsx
@@ -2,6 +2,7 @@ import { Button } from "@components/UI/Button.tsx";
import { useCallback, useEffect, useRef } from "react";
import { useToast } from "@core/hooks/useToast.ts";
import useLocalStorage from "@core/hooks/useLocalStorage.ts";
+import { useTranslation } from "react-i18next";
interface UseBackupReminderOptions {
reminderInDays?: number;
@@ -36,6 +37,8 @@ export function useBackupReminder({
onAccept = () => {},
reminderInDays = REMINDER_DAYS_ONE_WEEK,
}: UseBackupReminderOptions) {
+ const { t } = useTranslation("dialog");
+
const { toast } = useToast();
const toastShownRef = useRef(false);
const [reminderState, setReminderState] = useLocalStorage<
@@ -59,7 +62,7 @@ export function useBackupReminder({
toastShownRef.current = true;
const { dismiss } = toast({
- title: "Backup Reminder",
+ title: t("pkiBackupReminder.title"),
duration: TOAST_DURATION,
delay: TOAST_APPEAR_DELAY,
description: message,
@@ -75,7 +78,10 @@ export function useBackupReminder({
setReminderExpiry(reminderInDays);
}}
>
- Remind me in {reminderInDays} day{reminderInDays > 1 ? "s" : ""}
+ {t("pkiBackupReminder.remindLaterPrefix")} {reminderInDays}{" "}
+ {reminderInDays > 1
+ ? t("common:unit.day.plural").toLowerCase()
+ : t("common:unit.day.one").toLowerCase()}
),
diff --git a/src/i18n/config.ts b/src/i18n/config.ts
index b99f419c..6935b435 100644
--- a/src/i18n/config.ts
+++ b/src/i18n/config.ts
@@ -27,14 +27,15 @@ i18next
.use(LanguageDetector)
.init({
backend: {
- // this will lazy load resources from the i18n folder
+ // With this setup, {{lng}} will correctly resolve to 'en-US', 'fi-FI', etc.
loadPath: "/src/i18n/locales/{{lng}}/{{ns}}.json",
},
react: {
useSuspense: true,
},
+ nonExplicitSupportedLngs: true,
detection: {
- order: ["navigator", "localStorage"],
+ order: ["localStorage", "navigator"],
caches: ["localStorage"],
},
fallbackLng: {
@@ -44,6 +45,7 @@ i18next
"sv": ["sv-SE"],
"de": ["de-DE"],
},
+ fallbackLng: "en-US", // Default to US English if detection fails
fallbackNS: ["common", "ui", "dialog"],
debug: import.meta.env.MODE === "development",
ns: [
diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json
index efb44b14..5597f53a 100644
--- a/src/i18n/locales/en/common.json
+++ b/src/i18n/locales/en/common.json
@@ -54,6 +54,7 @@
"suffix": "ms"
},
"second": { "one": "Second", "plural": "Seconds" },
+ "day": { "one": "Day", "plural": "Days" },
"snr": "SNR",
"volt": { "one": "Volt", "plural": "Volts", "suffix": "V" },
"record": { "one": "Records", "plural": "Records" }
diff --git a/src/i18n/locales/en/dialog.json b/src/i18n/locales/en/dialog.json
index 23393156..28427867 100644
--- a/src/i18n/locales/en/dialog.json
+++ b/src/i18n/locales/en/dialog.json
@@ -93,7 +93,6 @@
"unignoreNode": "Unignore node"
},
"pkiBackup": {
- "description": "We recommend backing up your key data regularly. Would you like to back up now?",
"loseKeysWarning": "If you lose your keys, you will need to reset your device.",
"secureBackup": "Its important to backup your public and private keys and store your backup securely!",
"footer": "=== END OF KEYS ===",
@@ -103,6 +102,13 @@
"fileName": "meshtastic_keys_{{longName}}_{{shortName}}.txt",
"title": "Backup Keys"
},
+ "pkiBackupReminder": {
+ "description": "We recommend backing up your key data regularly. Would you like to back up now?",
+ "title": "Backup Reminder",
+ "remindLaterPrefix": "Remind me in",
+ "remindNever": "Never remind me",
+ "backupNow": "Back up now"
+ },
"pkiRegenerate": {
"description": "Are you sure you want to regenerate key pair?",
"title": "Regenerate Key Pair"
diff --git a/vercel.json b/vercel.json
index 24bca4be..52503763 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1,5 +1,11 @@
{
- "github": { "silent": true },
+ "$schema": "https://openapi.vercel.sh/vercel.json",
+ "rewrites": [
+ {
+ "source": "/((?!api|.*\\..*).*)",
+ "destination": "/index.html"
+ }
+ ],
"headers": [
{
"source": "/",