From 53aceaa41292defb9e61760b8e59f1aa865b0448 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 1 Mar 2019 11:44:44 +0000 Subject: [PATCH] Add fallback for languages file So we're not completely dependent on the alias being set --- src/languageHandler.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/languageHandler.js b/src/languageHandler.js index bc2bd429b5..9f08acdd32 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -338,8 +338,13 @@ export function getCurrentLanguage() { function getLangsJson() { return new Promise((resolve, reject) => { - // Webapp is a webpack resolve alias pointing to the output directory, see webpack config - const url = require('Webapp/i18n/languages.json'); + let url; + try { + // Webapp is a webpack resolve alias pointing to the output directory, see webpack config + url; = require('Webapp/i18n/languages.json'); + } catch (e) { + url = i18nFolder + 'languages.json'; + } request( { method: "GET", url }, (err, response, body) => {