From 607fa64c0596cecc3dfd3f89bb9598e829d341cf Mon Sep 17 00:00:00 2001 From: thislight Date: Wed, 13 Nov 2024 19:38:56 +0800 Subject: [PATCH] i18n: add little debug info --- src/platform/i18n.tsx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/platform/i18n.tsx b/src/platform/i18n.tsx index 70db7f3..ccc71e6 100644 --- a/src/platform/i18n.tsx +++ b/src/platform/i18n.tsx @@ -73,14 +73,18 @@ export function autoMatchRegion() { export function useRegion() { const appSettings = useStore($settings); - return createMemo(() => { - const settings = appSettings(); - if (typeof settings.region !== "undefined") { - return settings.region; - } else { - return autoMatchRegion(); - } - }); + return createMemo( + () => { + const settings = appSettings(); + if (typeof settings.region !== "undefined") { + return settings.region; + } else { + return autoMatchRegion(); + } + }, + "en_GB", + { name: "region" }, + ); } async function importDateFnLocale(tag: string): Promise { @@ -100,7 +104,9 @@ async function importDateFnLocale(tag: string): Promise { * Provides runtime values and fetch dependencies for date-fns locale */ export const DateFnScope: ParentComponent = (props) => { - const [dateFnLocale, setDateFnLocale] = createSignal(enGB); + const [dateFnLocale, setDateFnLocale] = createSignal(enGB, { + name: "dateFnLocale", + }); const region = useRegion(); createEffect(() => {