Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 53aceaa

Browse files
committed
Add fallback for languages file
So we're not completely dependent on the alias being set
1 parent 63c6f60 commit 53aceaa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/languageHandler.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,13 @@ export function getCurrentLanguage() {
338338

339339
function getLangsJson() {
340340
return new Promise((resolve, reject) => {
341-
// Webapp is a webpack resolve alias pointing to the output directory, see webpack config
342-
const url = require('Webapp/i18n/languages.json');
341+
let url;
342+
try {
343+
// Webapp is a webpack resolve alias pointing to the output directory, see webpack config
344+
url; = require('Webapp/i18n/languages.json');
345+
} catch (e) {
346+
url = i18nFolder + 'languages.json';
347+
}
343348
request(
344349
{ method: "GET", url },
345350
(err, response, body) => {

0 commit comments

Comments
 (0)