Skip to content

Commit

Permalink
Fix locales loading
Browse files Browse the repository at this point in the history
  • Loading branch information
MarmadileManteater committed Apr 9, 2024
1 parent aef5392 commit 7048a90
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/renderer/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ export async function loadLocale(locale) {
const response = await fetch(url)
const data = await response.json()
if (process.env.IS_ANDROID) {
const androidUrl = createWebURL(`/static/locales-android/${locale}.json`)
const response = await fetch(androidUrl)
const androidSpecificData = await response.json()
Object.assign(data, androidSpecificData)
try {
const androidUrl = createWebURL(`/static/locales-android/${locale}.json`)
const response = await fetch(androidUrl)
const androidSpecificData = await response.json()
Object.assign(data, androidSpecificData)
} catch (ex) {
console.warn(ex)
// pass
}
}
i18n.setLocaleMessage(locale, data)
}
Expand Down

0 comments on commit 7048a90

Please sign in to comment.