chore: remove unused code (#1989)

This commit is contained in:
crazywoola
2024-01-11 11:08:32 +08:00
committed by GitHub
parent f7939c758f
commit eed5fdd768
12 changed files with 7 additions and 298 deletions

View File

@@ -27,17 +27,3 @@ export const getLocaleOnServer = (): Locale => {
const matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
return matchedLocale
}
// We enumerate all dictionaries here for better linting and typescript support
// We also get the default import for cleaner types
const dictionaries = {
'en': () => import('@/dictionaries/en.json').then(module => module.default),
'zh-Hans': () => import('@/dictionaries/zh-Hans.json').then(module => module.default),
} as { [locale: string]: () => Promise<any> }
export const getDictionary = async (locale: Locale = 'en') => {
try {
return await dictionaries[locale]()
}
catch (e) { console.error('locale not found', locale) }
}