From 7224dd29d73fb88611fcd9933017f42a407fb272 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Thu, 26 Feb 2026 20:39:16 +0100 Subject: [PATCH] fix(settings/options/language): key not found because language wasn't loaded yet --- app/components/Common/ConfirmationModal.vue | 3 ++- .../Settings/BottomScreen/Menus/Options/Language.vue | 6 +----- app/stores/confirmationModal.ts | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/components/Common/ConfirmationModal.vue b/app/components/Common/ConfirmationModal.vue index 825080d..ba81324 100644 --- a/app/components/Common/ConfirmationModal.vue +++ b/app/components/Common/ConfirmationModal.vue @@ -42,7 +42,8 @@ onRender((ctx) => { ctx.textBaseline = "top"; ctx.fillStyle = "#ffffff"; - const lines = confirmationModal.text.split("\n").slice(0, MAX_LINES); + const rawText = typeof confirmationModal.text === "function" ? confirmationModal.text() : confirmationModal.text; + const lines = rawText.split("\n").slice(0, MAX_LINES); const totalTextHeight = lines.length * LINE_HEIGHT; const textStartY = BG_Y + Math.floor((BG_HEIGHT - totalTextHeight) / 2) - 2; diff --git a/app/components/Settings/BottomScreen/Menus/Options/Language.vue b/app/components/Settings/BottomScreen/Menus/Options/Language.vue index f88dd94..4e689d3 100644 --- a/app/components/Settings/BottomScreen/Menus/Options/Language.vue +++ b/app/components/Settings/BottomScreen/Menus/Options/Language.vue @@ -176,11 +176,7 @@ const handleActivateA = () => { setLocale(selectedLocale.code); confirmationModal.open({ - text: $t( - "settings.options.language.confirmation", - {}, - { locale: selectedLocale.code }, - ), + text: () => $t("settings.options.language.confirmation"), onClosed: async () => { await animateOutro(); store.closeSubMenu(true); diff --git a/app/stores/confirmationModal.ts b/app/stores/confirmationModal.ts index 1b11409..6cc059c 100644 --- a/app/stores/confirmationModal.ts +++ b/app/stores/confirmationModal.ts @@ -8,7 +8,7 @@ const MODAL_TIME = 0.25; export const useConfirmationModal = defineStore("confirmationModal", { state: () => ({ isOpen: false, - text: "", + text: "" as string | (() => string), aLabel: null as string | null, bLabel: null as string | null, onActivateA: null as (() => void) | null, @@ -24,7 +24,7 @@ export const useConfirmationModal = defineStore("confirmationModal", { actions: { open(options: { - text: string; + text: string | (() => string); aLabel?: string; bLabel?: string; onActivateA?: () => void;