chore: remove unused code (#1989)

This commit is contained in:
crazywoola 2024-01-11 11:08:32 +08:00 • committed by GitHub
commit eed5fdd768
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) }
}