1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Inline locale variable in fetchLocale fn

This commit is contained in:
Whymarrh Whitby 2018-07-09 17:24:12 -02:30
parent 4521de19e6
commit 2526f8a1d8

View File

@ -29,8 +29,7 @@ const getMessage = (locale, key, substitutions) => {
async function fetchLocale (localeName) { async function fetchLocale (localeName) {
try { try {
const response = await fetch(`./_locales/${localeName}/messages.json`) const response = await fetch(`./_locales/${localeName}/messages.json`)
const locale = await response.json() return await response.json()
return locale
} catch (error) { } catch (error) {
log.error(`failed to fetch ${localeName} locale because of ${error}`) log.error(`failed to fetch ${localeName} locale because of ${error}`)
return {} return {}