i18n: add little debug info
All checks were successful
/ depoly (push) Successful in 1m28s

This commit is contained in:
thislight 2024-11-13 19:38:56 +08:00
parent 637eda5ac1
commit 607fa64c05
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -73,14 +73,18 @@ export function autoMatchRegion() {
export function useRegion() {
const appSettings = useStore($settings);
return createMemo(() => {
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<Locale> {
@ -100,7 +104,9 @@ async function importDateFnLocale(tag: string): Promise<Locale> {
* 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(() => {