mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: handle error and console.log
This commit is contained in:
@@ -5,10 +5,10 @@ export const regionNames = new Intl.DisplayNames([locale], {type: 'region'})
|
||||
|
||||
if (locale !== 'en') {
|
||||
fetch(`/locales/${locale}.po.json`).then(response => {
|
||||
if (!response.ok) throw new Error(`Failed to load translations for locale ${locale}`);
|
||||
if (!response.ok) throw new Error(`Failed to load translations for locale ${locale}`)
|
||||
response.json().then(translationsObj => {
|
||||
addLocale(locale, translationsObj);
|
||||
useLocale(locale);
|
||||
addLocale(locale, translationsObj)
|
||||
useLocale(locale)
|
||||
})
|
||||
})
|
||||
}).catch(() => console.error(`Unable to retrieve translation file ${locale}.po.json`))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user