Skip to content

Commit a029f8d

Browse files
committed
fixup! fallback to synergism.cc for translations
1 parent 8bc4dc2 commit a029f8d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/i18n.ts

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const init = async (): Promise<void> => {
2424
const language = localStorage.getItem('language') ?? 'en'
2525

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

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

3739
languageCache.set('en', { translation: file })

src/purchases/ConsumablesTab.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ const initializeConsumablesTab = memoize(() => {
3434
const alert = await Confirm(`Please confirm you would like to activate a ${key} for 500 PseudoCoins`)
3535
if (!alert) return Alert('Purchase cancelled')
3636
else {
37-
sendToWebsocket(JSON.stringify({
38-
type: 'consume',
39-
consumable: key
40-
}))
41-
}
37+
sendToWebsocket(JSON.stringify({
38+
type: 'consume',
39+
consumable: key
40+
}))
41+
}
4242
})
4343
})
4444
})

0 commit comments

Comments
 (0)