Skip to content

Commit

Permalink
fixup! fallback to synergism.cc for translations
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Feb 11, 2025
1 parent 8bc4dc2 commit a029f8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const init = async (): Promise<void> => {
const language = localStorage.getItem('language') ?? 'en'

const response = await fetch(`./translations/${language}.json`)
.catch(() => fetch(`https://synergism.cc/translations/${language}.json`))
const file = await response.json() as Resource

languageCache.set(language, { translation: file })
Expand All @@ -32,6 +33,7 @@ export const init = async (): Promise<void> => {
if (language !== 'en') {
// We always need to load English, to use as a fallback
const response = await fetch('./translations/en.json')
.catch(() => fetch('https://synergism.cc/translations/en.json'))
const file = await response.json() as Resource

languageCache.set('en', { translation: file })
Expand Down
10 changes: 5 additions & 5 deletions src/purchases/ConsumablesTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const initializeConsumablesTab = memoize(() => {
const alert = await Confirm(`Please confirm you would like to activate a ${key} for 500 PseudoCoins`)
if (!alert) return Alert('Purchase cancelled')
else {
sendToWebsocket(JSON.stringify({
type: 'consume',
consumable: key
}))
}
sendToWebsocket(JSON.stringify({
type: 'consume',
consumable: key
}))
}
})
})
})
Expand Down

0 comments on commit a029f8d

Please sign in to comment.