Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Sep 27, 2024
1 parent fa71c43 commit fff446e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ const languageCache = new Map<string, { translation: Resource }>()

export const init = async (): Promise<void> => {
const resources: Record<string, Resource> = {}
const language = localStorage.getItem('language') ?? 'en'
let language: string
try {
language = localStorage.getItem('language') ?? 'en'
} catch {
language = 'en'
}

const response = await fetch(`./translations/${language}.json`)
const file = await response.json() as Resource
Expand Down

0 comments on commit fff446e

Please sign in to comment.