mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 02:01:30 +08:00
perf: enable strict ts type checking (#4045)
This commit is contained in:
@@ -58,9 +58,11 @@ async function loadI18nMessages(lang: SupportedLanguagesType) {
|
||||
return setI18nLanguage(lang);
|
||||
}
|
||||
|
||||
const message = await localesMap[lang]();
|
||||
const message = await localesMap[lang]?.();
|
||||
|
||||
i18n.global.setLocaleMessage(lang, message.default);
|
||||
if (message?.default) {
|
||||
i18n.global.setLocaleMessage(lang, message.default);
|
||||
}
|
||||
loadedLanguages.add(lang);
|
||||
return setI18nLanguage(lang);
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ export type ImportLocaleFn = () => Promise<{ default: Record<string, string> }>;
|
||||
|
||||
export type LoadMessageFn = (
|
||||
lang: SupportedLanguagesType,
|
||||
) => Promise<Record<string, string>>;
|
||||
) => Promise<Record<string, string> | undefined>;
|
||||
|
||||
export interface LocaleSetupOptions {
|
||||
/**
|
||||
|
Reference in New Issue
Block a user